From: Wez Furlong Date: Thu, 26 Sep 2002 16:22:28 +0000 (+0000) Subject: Fix for #19580. (Incorrectly warning about lost data when that is not the X-Git-Tag: MODERN_SYMMETRIC_SESSION_BEHAVIOUR_20021003~155 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=a95fb6bfd68f4a6ac1d019e0bda7b384d6dc30cc;p=php Fix for #19580. (Incorrectly warning about lost data when that is not the case on systems without fopencookie). --- diff --git a/main/streams.c b/main/streams.c index ba8176dd63..432f27fad1 100755 --- a/main/streams.c +++ b/main/streams.c @@ -1580,7 +1580,7 @@ PHPAPI int _php_stream_cast(php_stream *stream, int castas, void **ret, int show exit_success: - if (stream->writepos && stream->fclose_stdiocast != PHP_STREAM_FCLOSE_FOPENCOOKIE) { + if ((stream->writepos - stream->readpos) > 0 && stream->fclose_stdiocast != PHP_STREAM_FCLOSE_FOPENCOOKIE) { /* the data we have buffered will be lost to the third party library that * will be accessing the stream. Emit a warning so that the end-user will * know that they should try something else */