summaryrefslogtreecommitdiff
path: root/ext/standard/exec.c
diff options
context:
space:
mode:
authorIlia Alshanetsky <iliaa@php.net>2004-07-12 18:49:47 +0000
committerIlia Alshanetsky <iliaa@php.net>2004-07-12 18:49:47 +0000
commit11371cd0a8920d9cc2172edcad8b94d111fb205a (patch)
tree2d7d0e13ed547ec4d26b15ae25b04f1a6d6003a3 /ext/standard/exec.c
parent7daa1cfecc045a6977d743376da583cac5f564bb (diff)
downloadphp-git-11371cd0a8920d9cc2172edcad8b94d111fb205a.tar.gz
Missing patch.
Diffstat (limited to 'ext/standard/exec.c')
-rw-r--r--ext/standard/exec.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c
index 72fc668d2c..11bb365f65 100644
--- a/ext/standard/exec.c
+++ b/ext/standard/exec.c
@@ -197,11 +197,11 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode)
int ret;
if (mode) {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z", &cmd, &cmd_len, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/", &cmd, &cmd_len, &ret_code) == FAILURE) {
RETURN_FALSE;
}
} else {
- if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|zz", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
+ if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|z/z/", &cmd, &cmd_len, &ret_array, &ret_code) == FAILURE) {
RETURN_FALSE;
}
}
@@ -213,8 +213,10 @@ static void php_exec_ex(INTERNAL_FUNCTION_PARAMETERS, int mode)
if (!ret_array) {
ret = php_exec(mode, cmd, NULL, return_value TSRMLS_CC);
} else {
- zval_dtor(ret_array);
- array_init(ret_array);
+ if (Z_TYPE_P(ret_array) != IS_ARRAY) {
+ zval_dtor(ret_array);
+ array_init(ret_array);
+ }
ret = php_exec(2, cmd, ret_array, return_value TSRMLS_CC);
}
if (ret_code) {