From: Stanislav Malyshev Date: Tue, 1 Aug 2000 07:22:59 +0000 (+0000) Subject: When output is empty, exec should return "", not "\0" (#5775) X-Git-Tag: PRE_FILE_COMPILE_API_CHANGE~63 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=e109aa30d67b4c4747941b7066e5d057a48a2ea3;p=php When output is empty, exec should return "", not "\0" (#5775) @- Fixed exec() returning "\0" when output is empty --- diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 7fc6acc033..63409520f0 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -172,8 +172,9 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value) tmp = php_addslashes(buf, 0, &len, 0); RETVAL_STRINGL(tmp,len,0); - } else - RETVAL_STRINGL(buf,l+1,1); + } else { + RETVAL_STRINGL(buf,l?l+1:0,1); + } } else { int b, i;