diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2011-09-26 18:20:32 -0700 |
|---|---|---|
| committer | Mark Adler <madler@alumni.caltech.edu> | 2011-09-26 18:20:32 -0700 |
| commit | 50e440f081a0edc293dcfe7333a91d764e3d15cd (patch) | |
| tree | fba356e28c0424ea53a1465844c471f4cd42476c /gzlib.c | |
| parent | 5ad116abdad08c49b9ab20d748550eecd2c1d96d (diff) | |
| download | Project-Tick-50e440f081a0edc293dcfe7333a91d764e3d15cd.tar.gz Project-Tick-50e440f081a0edc293dcfe7333a91d764e3d15cd.zip | |
Allow gzrewind() and gzseek() after a premature end-of-file.
Diffstat (limited to 'gzlib.c')
| -rw-r--r-- | gzlib.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -265,7 +265,8 @@ int ZEXPORT gzrewind(file) state = (gz_statep)file; /* check that we're reading and that there's no error */ - if (state->mode != GZ_READ || state->err != Z_OK) + if (state->mode != GZ_READ || + (state->err != Z_OK && state->err != Z_BUF_ERROR)) return -1; /* back up and start over */ @@ -293,7 +294,7 @@ z_off64_t ZEXPORT gzseek64(file, offset, whence) return -1; /* check that there's no error */ - if (state->err != Z_OK) + if (state->err != Z_OK && state->err != Z_BUF_ERROR) return -1; /* can only seek from start or relative to current position */ |
