Package: zlib1g
Version: 1:1.2.2-3
Severity: important
Tags: patch

When reading a compressed file using gzread(), once EOF has been reached 
gzread() returns 0. From this point onward, gzread() always returns 0
even if the file continues to grow. This makes it impossible to tail (as
in tail -f) a continuously growing file. Problem is in the way gzread()
determines EOF. I am attaching a patch to fix this problem. I am sending
this bug report and patch to upstream zlib maintainer, Jean-Loup, as well.

-- System Information:
Debian Release: 3.1
  APT prefers testing
  APT policy: (500, 'testing'), (1, 'experimental')
Architecture: ia64
Kernel: Linux 2.6.8-1-mckinley
Locale: LANG=C, LC_CTYPE=C (charmap=ANSI_X3.4-1968)

Versions of packages zlib1g depends on:
ii  libc6.1                     2.3.2.ds1-20 GNU C Library: Shared libraries an

-- no debconf information


diff -urN zlib-1.2.2.orig/gzio.c zlib-1.2.2/gzio.c
--- zlib-1.2.2.orig/gzio.c      2004-10-03 22:30:37.000000000 -0400
+++ zlib-1.2.2/gzio.c   2005-03-01 16:43:05.000000000 -0500
@@ -403,7 +403,9 @@
     if (s == NULL || s->mode != 'r') return Z_STREAM_ERROR;
 
     if (s->z_err == Z_DATA_ERROR || s->z_err == Z_ERRNO) return -1;
-    if (s->z_err == Z_STREAM_END) return 0;  /* EOF */
+    if (s->z_eof == 1) {
+      return 0;  /* EOF */
+    }
 
     next_out = (Byte*)buf;
     s->stream.next_out = (Bytef*)buf;


-- 
To UNSUBSCRIBE, email to [EMAIL PROTECTED]
with a subject of "unsubscribe". Trouble? Contact [EMAIL PROTECTED]

Reply via email to