]> 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 ccb7e34632f9c57580e86c92fef75408c6804cac..c586d0110f838732bdffe988908587a097913b54 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;