cvs: /php4/ext/standard exec.c
| From: | Andrey Zmievski | Date: | Wed, 18 Aug 1999 17:23:02 +0000 |
| Subject: | cvs: /php4/ext/standard exec.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-3556@lists.php.net to get a copy of this message | ||
andrey Wed Aug 18 13:23:02 1999 EDT
Modified files:
/php4/ext/standard exec.c
Log:
Fixed bug #2105
Index: php4/ext/standard/exec.c
diff -u php4/ext/standard/exec.c:1.12 php4/ext/standard/exec.c:1.13
--- php4/ext/standard/exec.c:1.12 Mon Aug 2 15:16:50 1999
+++ php4/ext/standard/exec.c Wed Aug 18 13:23:01 1999
@@ -15,7 +15,7 @@
| Author: Rasmus Lerdorf |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.12 1999/08/02 19:16:50 zeev Exp $ */
+/* $Id: exec.c,v 1.13 1999/08/18 17:23:01 andrey Exp $ */
#include <stdio.h>
#include "php.h"
@@ -347,15 +347,18 @@
PHP_FUNCTION(escapeshellcmd)
{
pval *arg1;
- char *cmd;
+ char *cmd = NULL;
if (getParameters(ht, 1, &arg1) == FAILURE) {
WRONG_PARAM_COUNT;
}
- cmd = _php3_escapeshellcmd(arg1->value.str.val);
-
- RETVAL_STRING(cmd,1);
- efree(cmd);
+
+ convert_to_string(arg1);
+ if (arg1->value.str.len) {
+ cmd = _php3_escapeshellcmd(arg1->value.str.val);
+ RETVAL_STRING(cmd, 1);
+ efree(cmd);
+ }
}
/* }}} */