cvs: /php3/functions exec.c
| From: | Rasmus Lerdorf | Date: | Mon, 20 Mar 2000 06:43:57 +0000 |
| Subject: | cvs: /php3/functions exec.c | ||
| Groups: | php.dev | ||
| Request: | Send a blank email to php-dev+get-17064@lists.php.net to get a copy of this message | ||
rasmus Sun Mar 19 22:43:57 2000 EDT
Modified files:
/php3/functions exec.c
Log:
Make exec() and friends return last line of output, and be careful we don't
do it for the passthru() case
Index: php3/functions/exec.c
diff -u php3/functions/exec.c:1.90 php3/functions/exec.c:1.91
--- php3/functions/exec.c:1.90 Sun Feb 20 12:42:14 2000
+++ php3/functions/exec.c Sun Mar 19 22:43:57 2000
@@ -23,10 +23,10 @@
| If you did not, or have any questions about PHP licensing, please |
| contact core@php.net. |
+----------------------------------------------------------------------+
- | Author: Rasmus Lerdorf <rasmus@lerdorf.on.ca> |
+ | Author: Rasmus Lerdorf <rasmus@php.net> |
+----------------------------------------------------------------------+
*/
-/* $Id: exec.c,v 1.90 2000/02/20 20:42:14 eschmid Exp $ */
+/* $Id: exec.c,v 1.91 2000/03/20 06:43:57 rasmus Exp $ */
#include <stdio.h>
#include "php.h"
#include <ctype.h>
@@ -209,11 +209,15 @@
}
/* Return last line from the shell command */
- if (php3_ini.magic_quotes_runtime && type!=3) {
- int len;
+ if (type!=3) {
+ if(php3_ini.magic_quotes_runtime) {
+ int len;
- tmp = _php3_addslashes(buf, 0, &len, 0);
- RETVAL_STRINGL(tmp,len,0);
+ tmp = _php3_addslashes(buf, 0, &len, 0);
+ RETVAL_STRINGL(tmp,len,0);
+ } else {
+ RETVAL_STRING(buf,1);
+ }
}
ret = pclose(fp);