msvcrt-A07: _popen use wcmd.exe

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This patch in the msvcrt-A?? series implements Francois' suggestion
of launching wcmd.exe instead of C:\Windows\System32\cmd.exe.

License:
LGPL

Changelog:
* dlls/msvcrt/file.c: Jaco Greeff <jaco@puxedo.org>
- Use "wcmd.exe" instead of "C:\Windows\System32\cmd.exe" in _popen if 
the command interpreter identified by COMSPEC is not found

--[ inline patch ]--

diff -aurN msvcrt-A06/dlls/msvcrt/file.c msvcrt-A07/dlls/msvcrt/file.c
--- msvcrt-A06/dlls/msvcrt/file.c	Mon Nov  4 10:20:34 2002
+++ msvcrt-A07/dlls/msvcrt/file.c	Mon Nov  4 10:56:46 2002
@@ -106,7 +106,7 @@
  /* If we cannot find the interpretedr pointed to by COMSPEC,
   * this is the interpreter we will try to use
   */
-#define POPEN_WCMD_EXEC     "C:\\Windows\\System32\\cmd.exe"
+#define POPEN_WCMD_EXEC     "wcmd.exe"

  typedef struct
  {
@@ -2431,16 +2431,8 @@
       */
       if (!(GetEnvironmentVariableA("COMSPEC", szInterpreter, 1024)) ||
           (GetFileAttributesA(szInterpreter) == -1))
-     {
-        if ((GetFileAttributesA(POPEN_WCMD_EXEC) != -1))
-            snprintf(szInterpreter, 1024, "%s", POPEN_WCMD_EXEC);
-        else
-        {
-            TRACE("No available command interpreters or COMSPEC not 
set\n");
-            return NULL;
-        }
-     }
-
+        snprintf(szInterpreter, 1024, "%s", POPEN_WCMD_EXEC);
+
       TRACE("Using interpreter == %s\n", szInterpreter);

       /* _popen/_wpopen executes the required command via the command



[Index of Archives]     [Gimp for Windows]     [Red Hat]     [Samba]     [Yosemite Camping]     [Graphics Cards]     [Wine Home]

  Powered by Linux