]> granicus.if.org Git - php/commitdiff
Fix stream_eof result interpretation (and thus the user-streams test).
authorWez Furlong <wez@php.net>
Mon, 14 Oct 2002 00:16:02 +0000 (00:16 +0000)
committerWez Furlong <wez@php.net>
Mon, 14 Oct 2002 00:16:02 +0000 (00:16 +0000)
main/user_streams.c

index bf7d1411269fd52f1ab7ed3e707efb825caf2b28..9ee823f3dfc6af920684eaa97ed5162451fb597c 100644 (file)
@@ -477,11 +477,12 @@ static size_t php_userstreamop_read(php_stream *stream, char *buf, size_t count
                        &retval,
                        0, NULL, 0, NULL TSRMLS_CC);
 
-       if (!(call_result == SUCCESS && retval != NULL && zval_is_true(retval))) {
-               if (call_result == FAILURE) {
-                       php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF",
-                                       us->wrapper->classname);
-               }
+       if (call_result == SUCCESS && retval != NULL && zval_is_true(retval)) {
+               stream->eof = 1;
+       } else if (call_result == FAILURE) {
+               php_error_docref(NULL TSRMLS_CC, E_WARNING,
+                               "%s::" USERSTREAM_EOF " is not implemented! Assuming EOF",
+                               us->wrapper->classname);
 
                stream->eof = 1;
        }