]> granicus.if.org Git - php/commitdiff
Fix for #19580. (Incorrectly warning about lost data when that is not the
authorWez Furlong <wez@php.net>
Thu, 26 Sep 2002 16:22:28 +0000 (16:22 +0000)
committerWez Furlong <wez@php.net>
Thu, 26 Sep 2002 16:22:28 +0000 (16:22 +0000)
case on systems without fopencookie).

main/streams.c

index ba8176dd6358d155b95ea97ac25595050a02fb41..432f27fad192540517c6490bc1cd99a0cc164f3f 100755 (executable)
@@ -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 */