summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2002-09-26 16:22:28 +0000
committerWez Furlong <wez@php.net>2002-09-26 16:22:28 +0000
commita95fb6bfd68f4a6ac1d019e0bda7b384d6dc30cc (patch)
treeb67e78e4f802312e7825679257180c5350eca33d
parent4d9d06c87495c0afc0c912708191b6ab18997dbf (diff)
downloadphp-git-a95fb6bfd68f4a6ac1d019e0bda7b384d6dc30cc.tar.gz
Fix for #19580. (Incorrectly warning about lost data when that is not the
case on systems without fopencookie).
-rwxr-xr-xmain/streams.c2
1 files changed, 1 insertions, 1 deletions
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 */