com php-src: keep previous test to avoid any behavior change: main/streams/streams.c
| From: | Remi Collet | Date: | Tue, 02 Apr 2013 14:31:36 +0000 |
| Subject: | com php-src: keep previous test to avoid any behavior change: main/streams/streams.c | ||
| Groups: | php.cvs | ||
| Request: | Send a blank email to php-cvs+get-71828@lists.php.net to get a copy of this message | ||
Commit: 731a5c51040042a0f344752fee1117701efa3cfd
Author: Remi Collet <remi@php.net> Tue, 2 Apr 2013 16:31:36 +0200
Parents: 8e8a75444cbb6bb108e212d48513343fe21c9255
Branches: PHP-5.4 PHP-5.5 master
Link: http://git.php.net/?p=php-src.git;a=commitdiff;h=731a5c51040042a0f344752fee1117701efa3cfd
Log:
keep previous test to avoid any behavior change
Changed paths:
M main/streams/streams.c
Diff:
diff --git a/main/streams/streams.c b/main/streams/streams.c
index 7bc4c9d..cb80e9a 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;