Hi!

I've updated my patch to return null on EOF.

Unfortunately, on Linux this patch fails test stream_get_line_nb.phpt - looks like it changes the stream behavior in the non-blocking case.

Index: streams/streams.c
===================================================================
--- streams/streams.c   (revision 289073)
+++ streams/streams.c   (working copy)
@@ -890,6 +890,9 @@
                 size_t seek_len;

                 seek_len = stream->writepos - stream->readpos;
+               if(!seek_len)
+                       return FALSE;
+
                 if (seek_len>  maxlen) {
                         seek_len = maxlen;
                 }
@@ -901,10 +904,7 @@
                 }

                 if (!e) {
-                       if (seek_len<  maxlen&&  !stream->eof) {
-                               return NULL;
-                       }
-                       toread = maxlen;
+                       toread = (seek_len<  maxlen) ? seek_len : maxlen;
                 } else {
                         toread = e - (char *) stream->readbuf - 
stream->readpos;
                         skip = 1;



--
Stanislav Malyshev, Zend Software Architect
s...@zend.com   http://www.zend.com/
(408)253-8829   MSN: s...@zend.com

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to