summaryrefslogtreecommitdiff
path: root/ext/standard/proc_open.c
diff options
context:
space:
mode:
authorPierre Joye <pajoye@php.net>2010-09-08 08:34:57 +0000
committerPierre Joye <pajoye@php.net>2010-09-08 08:34:57 +0000
commit266ff49a9ae5dbf5fcc8b912ad6bb1b92e4a42c0 (patch)
tree788d5a42541551dc9ec63cea40d3ea70bc56ad5b /ext/standard/proc_open.c
parent9a1623dc5f8382a76b039e9abfab37e5449aa866 (diff)
downloadphp-git-266ff49a9ae5dbf5fcc8b912ad6bb1b92e4a42c0.tar.gz
- Fix #50524, proc_open should respect cwd as it does on other platforms
Diffstat (limited to 'ext/standard/proc_open.c')
-rw-r--r--ext/standard/proc_open.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/ext/standard/proc_open.c b/ext/standard/proc_open.c
index 0b4f5e0f12..988ea75875 100644
--- a/ext/standard/proc_open.c
+++ b/ext/standard/proc_open.c
@@ -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;