diff options
Diffstat (limited to 'ext/standard/php_fopen_wrapper.c')
-rw-r--r-- | ext/standard/php_fopen_wrapper.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/ext/standard/php_fopen_wrapper.c b/ext/standard/php_fopen_wrapper.c index 21fb97644b..4d50db76d6 100644 --- a/ext/standard/php_fopen_wrapper.c +++ b/ext/standard/php_fopen_wrapper.c @@ -91,13 +91,14 @@ static size_t php_stream_input_read(php_stream *stream, char *buf, size_t count stream->eof = 1; read_bytes = 0; } + /* Increment SG(read_post_bytes) only when something was actually read. */ + SG(read_post_bytes) += read_bytes; } else { stream->eof = 1; } } *position += read_bytes; - SG(read_post_bytes) += read_bytes; return read_bytes; } |