cvs: /php3/functions exec.c

From: Date: Mon, 20 Mar 2000 14:23:12 +0000
Subject: cvs: /php3/functions exec.c
Groups: php.dev 
Request: Send a blank email to php-dev+get-17091@lists.php.net to get a copy of this message
andrei Mon Mar 20 06:23:12 2000 EDT Modified files: /php3/functions exec.c Log: Rearrange the code a bit so it's consistent with PHP 4. Index: php3/functions/exec.c diff -u php3/functions/exec.c:1.91 php3/functions/exec.c:1.92 --- php3/functions/exec.c:1.91 Sun Mar 19 22:43:57 2000 +++ php3/functions/exec.c Mon Mar 20 06:23:12 2000 @@ -26,7 +26,7 @@ | Author: Rasmus Lerdorf <rasmus@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: exec.c,v 1.91 2000/03/20 06:43:57 rasmus Exp $ */ +/* $Id: exec.c,v 1.92 2000/03/20 14:23:12 andrei Exp $ */ #include <stdio.h> #include "php.h" #include <ctype.h> @@ -199,6 +199,15 @@ while (l && isspace((int)buf[--l])); if (l < t) buf[l + 1] = '\0'; + /* Return last line from the shell command */ + if(php3_ini.magic_quotes_runtime) { + int len; + + tmp = _php3_addslashes(buf, 0, &len, 0); + RETVAL_STRINGL(tmp,len,0); + } else { + RETVAL_STRINGL(buf,l+1,1); + } } else { int b, i; @@ -208,18 +217,6 @@ } } - /* Return last line from the shell command */ - if (type!=3) { - if(php3_ini.magic_quotes_runtime) { - int len; - - tmp = _php3_addslashes(buf, 0, &len, 0); - RETVAL_STRINGL(tmp,len,0); - } else { - RETVAL_STRING(buf,1); - } - } - ret = pclose(fp); #ifdef HAVE_SYS_WAIT_H if (WIFEXITED(ret)) {

« previous php.dev (#17091) next »