diff options
| author | Andi Gutmans <andi@php.net> | 1999-06-01 16:41:56 +0000 |
|---|---|---|
| committer | Andi Gutmans <andi@php.net> | 1999-06-01 16:41:56 +0000 |
| commit | 250d803c31ef575bea4f4fe274b937bfffb89625 (patch) | |
| tree | 2a2683b77f6059e3e2ef5774953eeef7441cea55 | |
| parent | 4ea6d477ec2f47cae7c6d43e6d467b438e440c63 (diff) | |
| download | php-git-250d803c31ef575bea4f4fe274b937bfffb89625.tar.gz | |
- Fix for exec to use API
| -rw-r--r-- | ext/standard/exec.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/ext/standard/exec.c b/ext/standard/exec.c index 121635589d..57ca05606b 100644 --- a/ext/standard/exec.c +++ b/ext/standard/exec.c @@ -140,17 +140,14 @@ static int _Exec(int type, char *cmd, pval *array, pval *return_value) #endif } else if (type == 2) { - pval tmp; - /* strip trailing whitespaces */ l = strlen(buf); t = l; while (l && isspace((int)buf[--l])); - if (l < t) buf[l + 1] = '\0'; - tmp.value.str.len = strlen(buf); - tmp.value.str.val = estrndup(buf,tmp.value.str.len); - tmp.type = IS_STRING; - _php3_hash_next_index_insert(array->value.ht,(void *) &tmp, sizeof(pval), NULL); + if (l < t) { + buf[l + 1] = '\0'; + } + add_next_index_string(array, buf, 1); } } |
