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

Alexandre Julliard julliard at winehq.org
Fri Nov 30 13:48:21 CST 2012


Module: wine
Branch: master
Commit: 64d7151669faccf09c845112c71a906587629ff7
URL:    http://source.winehq.org/git/wine.git/?a=commit;h=64d7151669faccf09c845112c71a906587629ff7

Author: Jason Edmeades <jason at 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;
         }




More information about the wine-cvs mailing list