iliaa Tue Feb 25 11:26:55 2003 EDT Added files: (Branch: PHP_4_3) /php4/ext/standard/tests/file bug22414.phpt
Modified files: /php4/ext/standard exec.c Log: MFH Index: php4/ext/standard/exec.c diff -u php4/ext/standard/exec.c:1.84.2.5 php4/ext/standard/exec.c:1.84.2.6 --- php4/ext/standard/exec.c:1.84.2.5 Wed Feb 19 19:34:24 2003 +++ php4/ext/standard/exec.c Tue Feb 25 11:26:54 2003 @@ -15,7 +15,7 @@ | Author: Rasmus Lerdorf | +----------------------------------------------------------------------+ */ -/* $Id: exec.c,v 1.84.2.5 2003/02/20 00:34:24 iliaa Exp $ */ +/* $Id: exec.c,v 1.84.2.6 2003/02/25 16:26:54 iliaa Exp $ */ #include <stdio.h> #include "php.h" @@ -278,7 +278,7 @@ } else { size_t b; - while ((b = fread(buf, buflen, 1, fp)) > 0) { + while((b = php_stream_read(stream, buf, EXEC_INPUT_BUF)) > 0) { if (output) { PHPWRITE(buf, b); } Index: php4/ext/standard/tests/file/bug22414.phpt +++ php4/ext/standard/tests/file/bug22414.phpt --TEST-- Bug #22414: passthru() does not read data correctly --SKIPIF-- <?php if (empty(@shell_exec("which cat")) { dir('skip cat binary needed for this test is not avaliable'); } ?> --POST-- --GET-- --FILE-- <?php $php = getenv('TEST_PHP_EXECUTABLE'); $pwd = realpath(dirname(__FILE__)); /* Regular Data Test */ passthru($php . ' -r " echo \"HELLO\"; "'); echo "\n"; /* Binary Data Test */ @unlink($pwd . '/passthru_test'); $cmd = $php . ' -r \' passthru("cat ' . $php . '"); \' > ' . $pwd . '/passthru_test'; exec($cmd); if (md5_file($php) == md5_file($pwd . '/passthru_test')) { echo "Works\n"; } else { echo "Does not work\n"; } @unlink($pwd . '/passthru_test'); ?> --EXPECT-- HELLO Works -- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php