From 7bd33ac4df4948609165e99f98c7bd44b46bdf88 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Herm=C3=A8s=20B=C3=A9lusca-Ma=C3=AFto?= Date: Sun, 19 Nov 2017 00:45:33 +0100 Subject: [PATCH] [CMD] Addendum to 26ff2c8 and to r40474 / 8cf1106: Fix CMD process exit code. As it appears, the process exit code of CMD /C is really the errorlevel, and not the "command's return value". --- base/shell/cmd/cmd.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/base/shell/cmd/cmd.c b/base/shell/cmd/cmd.c index 549f10d59ea..d9a03a265e2 100644 --- a/base/shell/cmd/cmd.c +++ b/base/shell/cmd/cmd.c @@ -1800,7 +1800,7 @@ Initialize(VOID) HMODULE NtDllModule; TCHAR commandline[CMDLINE_LENGTH]; TCHAR ModuleName[_MAX_PATH + 1]; - INT nExitCode; + // INT nExitCode; HANDLE hIn, hOut; @@ -1985,11 +1985,11 @@ Initialize(VOID) /* Do the /C or /K command */ GetCmdLineCommand(commandline, &ptr[2], AlwaysStrip); bWaitForCommand = TRUE; - nExitCode = ParseCommandLine(commandline); + /* nExitCode = */ ParseCommandLine(commandline); bWaitForCommand = FALSE; if (option != _T('K')) { - nErrorLevel = nExitCode; + // nErrorLevel = nExitCode; bExit = TRUE; } } -- 2.17.1