https://bugs.winehq.org/show_bug.cgi?id=42823
Bug ID: 42823 Summary: cmd.exe behaves differently from Win7 regarding redefined labels Product: Wine Version: 2.6 Hardware: x86 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: lorenz.witte@gmail.com Distribution: ---
Created attachment 57895 --> https://bugs.winehq.org/attachment.cgi?id=57895 CMD script shows label behavior difference
Wine's cmd.exe behaves differently regarding redefined labels in cmd/bat files. With Wine, it appears that the interpreter jumps to the last label with the correct name seen before a "goto" command, on Windows, it will jump to the next label after a "goto" command.
Please see the attached test file, it should make things clear. It will produce the output "I'm wine!" or "I'm windows!" respectively.
While it is certainly bad practice to redefine labels, unfortunately CMake creates such batch files when creating custom commands for Visual Studio builds.