diff options
Diffstat (limited to 'ext/standard/exec.c')
| -rw-r--r-- | ext/standard/exec.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 8bb8fefba5..7c440bf791 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -438,10 +438,9 @@ PHP_FUNCTION(escapeshellarg) PHP_FUNCTION(shell_exec) { FILE *in; - size_t total_readbytes; char *command; int command_len; - char *ret; + zend_string *ret; php_stream *stream; if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &command, &command_len) == FAILURE) { @@ -458,12 +457,11 @@ PHP_FUNCTION(shell_exec) } stream = php_stream_fopen_from_pipe(in, "rb"); - total_readbytes = php_stream_copy_to_mem(stream, &ret, PHP_STREAM_COPY_ALL, 0); + ret = php_stream_copy_to_mem(stream, PHP_STREAM_COPY_ALL, 0); php_stream_close(stream); - if (total_readbytes > 0) { -//??? RETVAL_STRINGL(ret, total_readbytes, 0); - RETVAL_STRINGL(ret, total_readbytes); + if (ret->len > 0) { + RETVAL_STR(ret); } } /* }}} */ |
