Browse Source

When output is empty, exec should return "", not "\0" (#5775)

@- Fixed exec() returning "\0" when output is empty
PHP-4.0.5
Stanislav Malyshev 26 years ago
parent
commit
e109aa30d6
  1. 5
      ext/standard/exec.c

5
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;

Loading…
Cancel
Save