]> granicus.if.org Git - php/commitdiff
- #51854, fix logic (patch by Tjerk)
authorPierre Joye <pajoye@php.net>
Tue, 18 May 2010 19:39:39 +0000 (19:39 +0000)
committerPierre Joye <pajoye@php.net>
Tue, 18 May 2010 19:39:39 +0000 (19:39 +0000)
main/streams/streams.c

index cbfccb4471e7ce79a7c98169c828b7797a3de11e..e698d4eb72f15c72ae73d026acf4a84223f98e45 100755 (executable)
@@ -1186,7 +1186,7 @@ PHPAPI int _php_stream_set_option(php_stream *stream, int option, int value, voi
                                /* try to match the buffer mode as best we can */
                                if (value == PHP_STREAM_BUFFER_NONE) {
                                        stream->flags |= PHP_STREAM_FLAG_NO_BUFFER;
-                               } else {
+                               } else if (stream->flags & PHP_STREAM_FLAG_NO_BUFFER) {
                                        stream->flags ^= PHP_STREAM_FLAG_NO_BUFFER;
                                }
                                ret = PHP_STREAM_OPTION_RETURN_OK;