PHP 4.0 Bug #8962 Updated: (8212) If the result of an exec() command is one character the result is empty.
| From: | stas@php.net | Date: | Thu, 22 Feb 2001 10:21:11 +0000 |
| Subject: | PHP 4.0 Bug #8962 Updated: (8212) If the result of an exec() command is one character the result is empty. | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-47231@lists.php.net to get a copy of this message | ||
ID: 8962
Updated by: stas
Reported By: bram@xspace.com
Status: Open
Old-Bug Type: Unknown/Other Function
Bug Type: Program Execution
Assigned To:
Comments:
reclassify
Previous Comments:
---------------------------------------------------------------------------
[2001-01-28 00:15:46] bram@xspace.com
This is the solution to problem 8212
File: ext/standard/exec.c
Function _Exec:
Contains:
RETVAL_STRINGL(buf,l?l+1:0,1);
However, it should contain:
RETVAL_STRINGL(buf,l?l+1:((isspace((int)buf[0]) || !buf[0])?0:1),1);
The problem lies in code previous which reads:
/* strip trailing spaces */
l = strlen(buf);
t = l;
while (l && isspace((int)buf[--l]));
if (l < t) buf[l + 1] = '