]> granicus.if.org Git - php/commitdiff
- revert fix for #43327, it breaks system&co functions
authorPierre Joye <pajoye@php.net>
Thu, 20 Aug 2009 09:03:19 +0000 (09:03 +0000)
committerPierre Joye <pajoye@php.net>
Thu, 20 Aug 2009 09:03:19 +0000 (09:03 +0000)
TSRM/tsrm_win32.c

index 291b9dddc3f6ddfc5d2c53e089c2e45f302cf162..59ebcb756447b59ef8e96badece2ea3c8ff14205 100644 (file)
@@ -313,6 +313,7 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
        HANDLE in, out;
        DWORD dwCreateFlags = 0;
        process_pair *proc;
+       char *cmd;
        TSRMLS_FETCH();
 
        security.nLength                                = sizeof(SECURITY_ATTRIBUTES);
@@ -349,9 +350,13 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
                dwCreateFlags |= CREATE_NO_WINDOW;
        }
 
-       if (!CreateProcess(NULL, command, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
+       cmd = (char*)malloc(strlen(command)+strlen(TWG(comspec))+sizeof(" /c ")+2);
+       sprintf(cmd, "%s /c \"%s\"", TWG(comspec), command);
+
+       if (!CreateProcess(NULL, cmd, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
                return NULL;
        }
+       free(cmd);
 
        CloseHandle(process.hThread);
        proc = process_get(NULL TSRMLS_CC);