[Zlib-devel] zlib 1.2.3.4 Winter Solstice Edition

Mark Brown broonie at sirena.org.uk
Mon Dec 28 13:57:24 EST 2009


On Mon, Dec 21, 2009 at 11:44:30PM -0800, Mark Adler wrote:

> zlib 1.2.3.4 is available here for testing:

>     http://zlib.net/current/beta/zlib-1.2.3.4.tar.gz

> Please give it a try and let me know how it goes.

I've also had to add another change to avoid triggering an issue with
the R statistical software:

Only check for and set the EOF flag if we've read zero bytes in from a
transparent stream, otherwise we may read the entire file into our
buffer (causing feof() to become true), flag EOF and begin reporting EOF
to users before we have actually returned all the data in the stream to
the application.

Index: debian/gzio.c
===================================================================
--- debian.orig/gzio.c	2009-12-28 18:48:57.000000000 +0000
+++ debian/gzio.c	2009-12-28 18:49:02.000000000 +0000
@@ -472,7 +472,7 @@
             len -= s->stream.avail_out;
             s->in  += len;
             s->out += len;
-            if (feof(s->file)) s->z_eof = 1;
+            if (len == 0 && feof(s->file)) s->z_eof = 1;
             return (int)len;
         }
         if (s->stream.avail_in == 0 && !s->z_eof) {




More information about the Zlib-devel mailing list