Commit e727e44d authored by Piotr Caban's avatar Piotr Caban Committed by Alexandre Julliard

cmd: Even if FindExecutable fails wait for process to finish in non-interactive mode.

parent b0bf0612
......@@ -1225,16 +1225,13 @@ void WCMD_run_program (WCHAR *command, BOOL called)
if (!status)
break;
if (!assumeInternal && !console) errorlevel = 0;
else
{
/* 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;
}
/* Always wait when non-interactive (cmd /c or in batch program),
or for console applications */
if (assumeInternal || !interactive || (console && !HIWORD(console)))
WaitForSingleObject (pe.hProcess, INFINITE);
GetExitCodeProcess (pe.hProcess, &errorlevel);
if (errorlevel == STILL_ACTIVE) errorlevel = 0;
CloseHandle(pe.hProcess);
CloseHandle(pe.hThread);
return;
......
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