From: Marcus Boerger Date: Thu, 6 Oct 2005 21:31:25 +0000 (+0000) Subject: - MFH Fix issue (endless loop) with temp/memory streams X-Git-Tag: php-5.1.0RC2~85 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=35c82a75eb91c37977b6e1ee5122c2a8d56b55ec;p=php - MFH Fix issue (endless loop) with temp/memory streams --- diff --git a/main/streams/memory.c b/main/streams/memory.c index 0b4beaf78c..0342c5b923 100644 --- a/main/streams/memory.c +++ b/main/streams/memory.c @@ -313,7 +313,13 @@ static size_t php_stream_temp_read(php_stream *stream, char *buf, size_t count T ts = stream->abstract; assert(ts != NULL); - return php_stream_read(ts->innerstream, buf, count); + size_t got = php_stream_read(ts->innerstream, buf, count); + + if (!got) { + stream->eof |= ts->innerstream->eof; + } + + return got; } /* }}} */