From: Ilia Alshanetsky Date: Wed, 6 Jan 2010 12:54:53 +0000 (+0000) Subject: Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but returns... X-Git-Tag: php-5.4.0alpha1~191^2~2123 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=1aca4221bd806692d2a0e1d4e9dff708b134342a;p=php Fixed bug #50657 (copy() with an empty (zero-byte) HTTP source succeeds but returns false). --- diff --git a/main/streams/streams.c b/main/streams/streams.c index c70bd49a5b..8b394deb27 100755 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1877,7 +1877,7 @@ static size_t _php_stream_copy_to_stream_common(php_stream *src, php_stream *des /* we've got at least 1 byte to read. * less than 1 is an error */ - if (haveread > 0) { + if (haveread > 0 || src->eof) { return SUCCESS; } return FAILURE;