Date: Monday, December 28, 2009 @ 17:02:36 Author: pierre Revision: 61945
see http://packages.qa.debian.org/z/zlib/news/20091228T194714Z.html Added: zlib/trunk/revert-transparent-feof-test.patch Modified: zlib/trunk/PKGBUILD ------------------------------------+ PKGBUILD | 9 ++++++--- revert-transparent-feof-test.patch | 19 +++++++++++++++++++ 2 files changed, 25 insertions(+), 3 deletions(-) Modified: PKGBUILD =================================================================== --- PKGBUILD 2009-12-28 18:46:03 UTC (rev 61944) +++ PKGBUILD 2009-12-28 22:02:36 UTC (rev 61945) @@ -3,7 +3,7 @@ pkgname=zlib pkgver=1.2.3.4 -pkgrel=2 +pkgrel=3 pkgdesc='compression library implementing the deflate compression method found in gzip and PKZIP' arch=('i686' 'x86_64') license=('custom') @@ -12,10 +12,12 @@ depends=('glibc') # source from http://packages.qa.debian.org/z/zlib.html source=("ftp://ftp.archlinux.org/other/zlib/zlib-${pkgver}.tar.gz" - 'install.patch' 'revert-eof-reporting.patch') + 'install.patch' 'revert-eof-reporting.patch' + 'revert-transparent-feof-test.patch') md5sums=('70cad33163abe3c234939a5c63bf95ea' 'e0b303fabe9272803ab57d988be1e88e' - '40293a11f8d5032af18c31c8522feb7e') + '40293a11f8d5032af18c31c8522feb7e' + '79c0b09bfe269883cb36f8f29993cbcf') build() { cd ${srcdir}/zlib-$pkgver @@ -23,6 +25,7 @@ export CFLAGS="${CFLAGS/-O2/-O3} -DUNALIGNED_OK" patch -p1 -i ${srcdir}/install.patch || return 1 patch -p1 -i ${srcdir}/revert-eof-reporting.patch || return 1 + patch -p1 -i ${srcdir}/revert-transparent-feof-test.patch || return 1 ./configure --prefix=/usr --shared if [ "${CARCH}" == "x86_64" ]; then ln -s contrib/amd64/amd64-match.S match.S Added: revert-transparent-feof-test.patch =================================================================== --- revert-transparent-feof-test.patch (rev 0) +++ revert-transparent-feof-test.patch 2009-12-28 22:02:36 UTC (rev 61945) @@ -0,0 +1,19 @@ +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) {