From e9e5eba74b4ee154f65528327d75762ec45449bb Mon Sep 17 00:00:00 2001 From: Pierre Joye Date: Thu, 20 Aug 2009 09:03:19 +0000 Subject: [PATCH] - revert fix for #43327, it breaks system&co functions --- TSRM/tsrm_win32.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/TSRM/tsrm_win32.c b/TSRM/tsrm_win32.c index 291b9dddc3..59ebcb7564 100644 --- a/TSRM/tsrm_win32.c +++ b/TSRM/tsrm_win32.c @@ -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); -- 2.50.1