From: Marcus Boerger Date: Thu, 6 Oct 2005 21:30:56 +0000 (+0000) Subject: - Fix issue (endless loop) with temp/memory streams X-Git-Tag: RELEASE_0_9_1~213 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a27f5b066573603cb64c5105c7884946cac45b2b;p=php - 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; } /* }}} */