From: Remi Collet Date: Tue, 2 Apr 2013 14:31:36 +0000 (+0200) Subject: keep previous test to avoid any behavior change X-Git-Tag: php-5.5.0beta3~8^2~28^2 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=731a5c51040042a0f344752fee1117701efa3cfd;p=php keep previous test to avoid any behavior change --- diff --git a/main/streams/streams.c b/main/streams/streams.c index 7bc4c9ddb5..cb80e9a16b 100644 --- a/main/streams/streams.c +++ b/main/streams/streams.c @@ -1535,8 +1535,10 @@ PHPAPI int _php_stream_copy_to_stream_ex(php_stream *src, php_stream *dest, size *len = didwrite; - /* read bytes match written */ - if (mapped == didwrite) { + /* we've got at least 1 byte to read + * less than 1 is an error + * AND read bytes match written */ + if (mapped > 0 && mapped == didwrite) { return SUCCESS; } return FAILURE;