summaryrefslogtreecommitdiff
path: root/lang/php80/patches/patch-main_streams_streams.c
blob: 8aeaf590ff0ce3b46413a03b3ee5a611ba7b848d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
$NetBSD: patch-main_streams_streams.c,v 1.1 2022/05/21 16:00:11 taca Exp $

* Allow copying files with size zero.

--- main/streams/streams.c.orig	2022-05-10 08:07:35.000000000 +0000
+++ main/streams/streams.c
@@ -1575,10 +1575,8 @@ PHPAPI int _php_stream_copy_to_stream_ex
 
 				*len = haveread += 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) {
+				/* read bytes match written */
+				if (mapped != didwrite) {
 					return FAILURE;
 				}
 				if (mapped < chunk_size) {