wez             Sat Oct  5 12:26:58 2002 EDT

  Modified files:              
    /php4/ext/bz2       bz2.c 
  Log:
  This got omitted from an earlier commit.
  EOF related checks for bzip2 streams.
  
  
Index: php4/ext/bz2/bz2.c
diff -u php4/ext/bz2/bz2.c:1.60 php4/ext/bz2/bz2.c:1.61
--- php4/ext/bz2/bz2.c:1.60     Thu Sep 26 06:14:41 2002
+++ php4/ext/bz2/bz2.c  Sat Oct  5 12:26:57 2002
@@ -16,7 +16,7 @@
    +----------------------------------------------------------------------+
  */
  
-/* $Id: bz2.c,v 1.60 2002/09/26 10:14:41 wez Exp $ */
+/* $Id: bz2.c,v 1.61 2002/10/05 16:26:57 wez Exp $ */
 
 #ifdef HAVE_CONFIG_H
 #include "config.h"
@@ -84,15 +84,14 @@
 static size_t php_bz2iop_read(php_stream *stream, char *buf, size_t count TSRMLS_DC)
 {
        struct php_bz2_stream_data_t *self = (struct php_bz2_stream_data_t *) 
stream->abstract;
-
-       if (buf == NULL && count == 0) {
-               /* we have no way of knowing, so let them try to read some more;
-                * then they will get an error and can stop 
-                */
-               return 0;
-       }
+       size_t ret;
        
-       return BZ2_bzread(self->bz_file, buf, count); 
+       ret = BZ2_bzread(self->bz_file, buf, count);
+
+       if (ret == 0)
+               stream->eof = 1;
+
+       return ret;
 }
 
 static size_t php_bz2iop_write(php_stream *stream, const char *buf, size_t count 
TSRMLS_DC)



-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to