eric pouech (@epo) commented about programs/cmd/builtins.c:
+ errorlevel = -1; + } + return errorlevel; +} + +static RETURN_CODE WCMD_mode_con(WCHAR *args) +{ + CONSOLE_SCREEN_BUFFER_INFO inf; + UINT keybd_speed, keybd_delay; + BOOL changed = FALSE; + WCHAR buf[1024]; + HANDLE console; + WCHAR *argN; + int argno; + + errorlevel = 0; for consistency with other bultins:
* I'd rather use a local variable RETURN_CODE return_code * return that variable from the builtin command * and set errorlevel only at the end of the function, depending on return_code value Note: this is the first time we have a -1 errorlevel, so we have have some other surprises -- https://gitlab.winehq.org/wine/wine/-/merge_requests/7491#note_97391