moriyoshi Sat Feb 15 14:59:27 2003 EDT Modified files: (Branch: PHP_4_3) /php4/main streams.c Log: MFH(r1.155): Fixed bug #22234 Index: php4/main/streams.c diff -u php4/main/streams.c:1.125.2.30 php4/main/streams.c:1.125.2.31 --- php4/main/streams.c:1.125.2.30 Thu Feb 13 16:03:25 2003 +++ php4/main/streams.c Sat Feb 15 14:59:26 2003 @@ -20,7 +20,7 @@ +----------------------------------------------------------------------+ */ -/* $Id: streams.c,v 1.125.2.30 2003/02/13 21:03:25 wez Exp $ */ +/* $Id: streams.c,v 1.125.2.31 2003/02/15 19:59:26 moriyoshi Exp $ */ #define _GNU_SOURCE #include "php.h" @@ -1200,6 +1200,17 @@ /* fall through - we might be able to copy in smaller chunks */ } #endif + + { + php_stream_statbuf sbuf; + if (php_stream_stat(src, &sbuf TSRMLS_CC) == 0) { + /* in the event that the source file is 0 bytes, return 1 to +indicate success + * because opening the file to write had already created a +copy */ + if (sbuf.sb.st_size == 0) { + return 1; + } + } + } while(1) { readchunk = sizeof(buf);
-- PHP CVS Mailing List (http://www.php.net/) To unsubscribe, visit: http://www.php.net/unsub.php