cmd: Do not change errorlevel when setting environment variables.

Changes CMD to set its errorlevel to 0 only when the value of an environment variable
is set in in non-interactive / batch mode, retains the previous value otherwise.

Wine-Bug: https://bugs.winehq.org/show_bug.cgi?id=47791
Signed-off-by: Florian Eder <others.meder@gmail.com>
Signed-off-by: Zebediah Figura <zfigura@codeweavers.com>
Signed-off-by: Alexandre Julliard <julliard@winehq.org>
(cherry picked from commit 617d14bc12)
Signed-off-by: Michael Stefaniuc <mstefani@winehq.org>
This commit is contained in:
Florian Eder 2021-06-01 07:02:54 +00:00 committed by Michael Stefaniuc
parent f2a45ae5c4
commit bc6346ba85
1 changed files with 1 additions and 1 deletions

View File

@ -4222,7 +4222,7 @@ void WCMD_setshow_env (WCHAR *s) {
if ((!status) & (gle == ERROR_ENVVAR_NOT_FOUND)) { if ((!status) & (gle == ERROR_ENVVAR_NOT_FOUND)) {
errorlevel = 1; errorlevel = 1;
} else if (!status) WCMD_print_error(); } else if (!status) WCMD_print_error();
else errorlevel = 0; else if (!interactive) errorlevel = 0;
} }
} }