From b298ce0dd03148c3447592dcd7294931fd6f6cbb Mon Sep 17 00:00:00 2001 From: Moriyoshi Koizumi Date: Sat, 15 Feb 2003 19:59:26 +0000 Subject: [PATCH] MFH(r1.155): Fixed bug #22234 --- main/streams.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/main/streams.c b/main/streams.c index 45eee09077..6b3a020dd1 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1201,6 +1201,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); -- 2.50.1