https://bugs.winehq.org/show_bug.cgi?id=57139
Bug ID: 57139 Summary: SET changes errorlevel in .bat files Product: Wine Version: 9.16 Hardware: x86-64 OS: Linux Status: UNCONFIRMED Severity: normal Priority: P2 Component: cmd Assignee: wine-bugs@winehq.org Reporter: huangqinjin@gmail.com Distribution: ---
errorlevel was changed to 0 after SET, while Windows CMD keep it unchanged.
Quote from https://stackoverflow.com/a/34968021 and https://stackoverflow.com/a/148991:
The differences between .CMD and .BAT as far as CMD.EXE is concerned are: With extensions enabled, PATH/APPEND/PROMPT/SET/ASSOC in .CMD files will set ERRORLEVEL regardless of error. .BAT sets ERRORLEVEL only on errors.
test.bat:
@echo off
call :SetError
echo %errorlevel% echo %errorlevel% SET x= echo %errorlevel%
exit /B 0
:SetError exit /B 2
https://bugs.winehq.org/show_bug.cgi?id=57139
Ken Sharp imwellcushtymelike@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |source, testcase
https://bugs.winehq.org/show_bug.cgi?id=57139
Austin English austinenglish@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Keywords| |download
https://bugs.winehq.org/show_bug.cgi?id=57139
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|UNCONFIRMED |NEW Ever confirmed|0 |1 CC| |dark.shadow4@web.de
--- Comment #1 from Fabian Maurer dark.shadow4@web.de --- Confirming.
https://bugs.winehq.org/show_bug.cgi?id=57139
Eric Pouech eric.pouech@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |eric.pouech@gmail.com
--- Comment #2 from Eric Pouech eric.pouech@gmail.com --- should be fixed by c1034c3e006054633faad74aecc261c6975f0301
https://bugs.winehq.org/show_bug.cgi?id=57139
Fabian Maurer dark.shadow4@web.de changed:
What |Removed |Added ---------------------------------------------------------------------------- Resolution|--- |FIXED Status|NEW |RESOLVED Fixed by SHA1| |c1034c3e006054633faad74aecc | |261c6975f0301
--- Comment #3 from Fabian Maurer dark.shadow4@web.de --- Marking fixed by https://gitlab.winehq.org/wine/wine/-/commit/c1034c3e006054633faad74aecc261c...
https://bugs.winehq.org/show_bug.cgi?id=57139
Alexandre Julliard julliard@winehq.org changed:
What |Removed |Added ---------------------------------------------------------------------------- Status|RESOLVED |CLOSED
--- Comment #4 from Alexandre Julliard julliard@winehq.org --- Closing bugs fixed in 9.19.