]> granicus.if.org Git - php/commitdiff
- Fix #50524, proc_open should respect cwd as it does on other platforms
authorPierre Joye <pajoye@php.net>
Wed, 8 Sep 2010 08:34:57 +0000 (08:34 +0000)
committerPierre Joye <pajoye@php.net>
Wed, 8 Sep 2010 08:34:57 +0000 (08:34 +0000)
NEWS
ext/standard/proc_open.c

diff --git a/NEWS b/NEWS
index 9461892ebe0e294e3846632c7b85d97e0c112ba6..f955586795037a443ce3078742376741af695dd6 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -75,6 +75,8 @@
   (a_jelly_doughnut at phpbb dot com, Pierre)
 - Fixed #50953, socket will not connect to IPv4 address when the host has both
   IPv4 and IPv6 addresses, on Windows. (Gustavo, Pierre)
+- Fixed #50524, proc_open on Windows does not respect cwd as it does on other
+  platforms. (Pierre)
 
 22 Jul 2010, PHP 5.3.3
 - Upgraded bundled sqlite to version 3.6.23.1. (Ilia)
index 0b4f5e0f12baeeb3bbc673e69f800987844b4916..988ea75875a6da619d9f72ca78a1ffcbc2671717 100644 (file)
@@ -752,6 +752,16 @@ PHP_FUNCTION(proc_open)
        }
 
 #ifdef PHP_WIN32
+       if (cwd == NULL) {
+               char cur_cwd[MAXPATHLEN];
+               char *getcwd_result;
+               getcwd_result = VCWD_GETCWD(cur_cwd, MAXPATHLEN);
+               if (!getcwd_result) {
+                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot get current directory");
+                       goto exit_fail;
+               }
+       }
+
        memset(&si, 0, sizeof(si));
        si.cb = sizeof(si);
        si.dwFlags = STARTF_USESTDHANDLES;