]> granicus.if.org Git - php/commitdiff
- fixed #43327, wrong return value from mail(), if sendmail_path is wrong
authorPierre Joye <pajoye@php.net>
Wed, 19 Aug 2009 18:43:46 +0000 (18:43 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 19 Aug 2009 18:43:46 +0000 (18:43 +0000)
TSRM/tsrm_win32.c

index f49a711b2e2f14566516cce5cc0d67dcef01c4bc..291b9dddc3f6ddfc5d2c53e089c2e45f302cf162 100644 (file)
@@ -312,7 +312,6 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
        SECURITY_ATTRIBUTES security;
        HANDLE in, out;
        DWORD dwCreateFlags = 0;
-       char *cmd;
        process_pair *proc;
        TSRMLS_FETCH();
 
@@ -350,12 +349,9 @@ TSRM_API FILE *popen_ex(const char *command, const char *type, const char *cwd,
                dwCreateFlags |= CREATE_NO_WINDOW;
        }
 
-       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)) {
+       if (!CreateProcess(NULL, command, &security, &security, security.bInheritHandle, dwCreateFlags, env, cwd, &startup, &process)) {
                return NULL;
        }
-       free(cmd);
 
        CloseHandle(process.hThread);
        proc = process_get(NULL TSRMLS_CC);