Commit 64d71516 authored by Jason Edmeades's avatar Jason Edmeades Committed by Alexandre Julliard

cmd: Wait for command to complete when spawned through cmd /c.

parent 8b98b6a5
...@@ -1201,8 +1201,10 @@ void WCMD_run_program (WCHAR *command, BOOL called) ...@@ -1201,8 +1201,10 @@ void WCMD_run_program (WCHAR *command, BOOL called)
if (!assumeInternal && !console) errorlevel = 0; if (!assumeInternal && !console) errorlevel = 0;
else else
{ {
/* Always wait when called in a batch program context */ /* Always wait when non-interactive (cmd /c or in batch program),
if (assumeInternal || context || !HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE); or for console applications */
if (assumeInternal || !interactive || !HIWORD(console))
WaitForSingleObject (pe.hProcess, INFINITE);
GetExitCodeProcess (pe.hProcess, &errorlevel); GetExitCodeProcess (pe.hProcess, &errorlevel);
if (errorlevel == STILL_ACTIVE) errorlevel = 0; if (errorlevel == STILL_ACTIVE) errorlevel = 0;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment