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)
if (!assumeInternal && !console) errorlevel = 0;
else
{
/* Always wait when called in a batch program context */
if (assumeInternal || context || !HIWORD(console)) WaitForSingleObject (pe.hProcess, INFINITE);
/* Always wait when non-interactive (cmd /c or in batch program),
or for console applications */
if (assumeInternal || !interactive || !HIWORD(console))
WaitForSingleObject (pe.hProcess, INFINITE);
GetExitCodeProcess (pe.hProcess, &errorlevel);
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