From: Mark Adler Date: Tue, 27 Sep 2011 01:20:32 +0000 (-0700) Subject: Allow gzrewind() and gzseek() after a premature end-of-file. X-Git-Tag: upstream/1.2.8~238 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=50e440f081a0edc293dcfe7333a91d764e3d15cd;p=platform%2Fupstream%2Fzlib.git Allow gzrewind() and gzseek() after a premature end-of-file. --- diff --git a/gzlib.c b/gzlib.c index e8cb479..c59bcda 100644 --- a/gzlib.c +++ b/gzlib.c @@ -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 */