https://bugs.winehq.org/show_bug.cgi?id=52107
Bug ID: 52107 Summary: %ERRORLEVEL% shall not be reset when setting an environment variable in a batch file Product: Wine Version: 6.22 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: jinoh.kang.kr@gmail.com CC: others.meder@gmail.com Distribution: ---
The fix in https://bugs.winehq.org/show_bug.cgi?id=47791 (commit 617d14bc1238b57327a8400eda1c1ab22624beb7) is incomplete; it only applies to interactive case, and the bug is left unchanged for the batch mode case.
When a variable is successfully set, %ERRORLEVEL% is left as-is regardless of whether the interpreter is in batch mode or not.
See also: https://ss64.com/nt/set.html
https://bugs.winehq.org/show_bug.cgi?id=52107
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Keywords| |download, source Ever confirmed|0 |1
--- Comment #1 from Ken Sharp imwellcushtymelike@gmail.com --- Confirming.
https://bugs.winehq.org/show_bug.cgi?id=52107
--- Comment #2 from Jinoh Kang jinoh.kang.kr@gmail.com --- No idea why, but my patch is failing tests on real Windows VMs. Maybe this is no longer the case anymore on cmd.exe of newer Windows versions?
https://bugs.winehq.org/show_bug.cgi?id=52107
--- Comment #3 from Florian Eder others.meder@gmail.com --- The CMD seems to distinguish between batch mode and interactive mode in this case. In batch mode ERRORLEVEL is reset to 0, in interactive mode it is not.
This seems to be consistent since (at least) Windows XP. Probably a bug in the Windows CMD that only applies to one of the two modes?
https://bugs.winehq.org/show_bug.cgi?id=52107
Jinoh Kang jinoh.kang.kr@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|NEW |RESOLVED Resolution|--- |INVALID
--- Comment #4 from Jinoh Kang jinoh.kang.kr@gmail.com --- INVALID.
https://bugs.winehq.org/show_bug.cgi?id=52107
Jinoh Kang jinoh.kang.kr@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #5 from Jinoh Kang jinoh.kang.kr@gmail.com --- Closing.