summaryrefslogtreecommitdiff
path: root/gzguts.h
diff options
context:
space:
mode:
authorMark Adler <madler@alumni.caltech.edu>2011-10-12 23:24:31 -0700
committerMark Adler <madler@alumni.caltech.edu>2011-12-11 18:22:04 -0800
commit98f5779f4257682ba9b5fc490557618e3f15f84b (patch)
tree09082da8f556b04ba8aa299cf55eb979a3dfa063 /gzguts.h
parent70e3b1ca56f2ffe8944d3ac0d59b8781127bf94f (diff)
downloadzlib-98f5779f4257682ba9b5fc490557618e3f15f84b.tar.gz
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.
Diffstat (limited to 'gzguts.h')
-rw-r--r--gzguts.h5
1 files changed, 3 insertions, 2 deletions
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 */