From 98f5779f4257682ba9b5fc490557618e3f15f84b Mon Sep 17 00:00:00 2001 From: Mark Adler Date: Wed, 12 Oct 2011 23:24:31 -0700 Subject: Fix gzeof() to behave just like feof() when read is not past end of file. Before, gzeof() would return true (accurately) when the last read request went just up to the end of the uncompressed data. In the analogous case, feof() would return false, only returning true when a read request goes past the end of the file. This patch corrects gzeof() to behave in the same way as feof(), as noted in the zlib.h documentation. --- gzguts.h | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'gzguts.h') diff --git a/gzguts.h b/gzguts.h index eefdca0..07c7ac3 100644 --- a/gzguts.h +++ b/gzguts.h @@ -155,9 +155,10 @@ typedef struct { unsigned char *out; /* output buffer (double-sized when reading) */ int direct; /* 0 if processing gzip, 1 if transparent */ /* just for reading */ - int eof; /* true if end of input file reached */ - z_off64_t start; /* where the gzip data started, for rewinding */ int how; /* 0: get header, 1: copy, 2: decompress */ + z_off64_t start; /* where the gzip data started, for rewinding */ + int eof; /* true if end of input file reached */ + int past; /* true if read requested past end */ /* just for writing */ int level; /* compression level */ int strategy; /* compression strategy */ -- cgit v1.2.3-55-g6feb