Module: wine Branch: master Commit: 64d7151669faccf09c845112c71a906587629ff7 URL: http://source.winehq.org/git/wine.git/?a=commit;h=64d7151669faccf09c845112c7...
Author: Jason Edmeades jason@edmeades.me.uk Date: Thu Nov 29 23:23:25 2012 +0000
cmd: Wait for command to complete when spawned through cmd /c.
---
programs/cmd/wcmdmain.c | 6 ++++-- 1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/programs/cmd/wcmdmain.c b/programs/cmd/wcmdmain.c index cb9fab6..e373d19 100644 --- a/programs/cmd/wcmdmain.c +++ b/programs/cmd/wcmdmain.c @@ -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; }