diff options
| author | Pierre Joye <pajoye@php.net> | 2010-09-08 08:34:57 +0000 |
|---|---|---|
| committer | Pierre Joye <pajoye@php.net> | 2010-09-08 08:34:57 +0000 |
| commit | 367bd11d6f0ef7ac674914bde9e07d559207e92f (patch) | |
| tree | b1a646f52a6dcbda87ff90f62ef615a9414223da | |
| parent | 411f9fbe4d034bacbcabf5aa1f95b2c273d38ee3 (diff) | |
| download | php-git-367bd11d6f0ef7ac674914bde9e07d559207e92f.tar.gz | |
- Fix #50524, proc_open should respect cwd as it does on other platforms
| -rw-r--r-- | ext/standard/proc_open.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c index 95740a1d91..6f4d88e942 100644 --- a/ext/standard/proc_open.c +++ b/ext/standard/proc_open.c @@ -677,6 +677,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; |
