From: Moriyoshi Koizumi Date: Sat, 15 Feb 2003 19:56:12 +0000 (+0000) Subject: Fixed bug #22234 X-Git-Tag: RELEASE_0_5~995 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22517ce0de20456ced990e4ae74267a61f54d590;p=php Fixed bug #22234 --- diff --git a/main/streams.c b/main/streams.c index 2a97033e4a..67e961540b 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1207,6 +1207,17 @@ PHPAPI size_t _php_stream_copy_to_stream(php_stream *src, php_stream *dest, size } #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);