Fix bug when gzungetc() is used immediately after gzopen().
This commit is contained in:
parent
c7ddcc2e0e
commit
7dd6aa7245
4
gzread.c
4
gzread.c
@ -443,6 +443,10 @@ int ZEXPORT gzungetc(int c, gzFile file) {
|
||||
return -1;
|
||||
state = (gz_statep)file;
|
||||
|
||||
/* in case this was just opened, set up the input buffer */
|
||||
if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0)
|
||||
(void)gz_look(state);
|
||||
|
||||
/* check that we're reading and that there's no (serious) error */
|
||||
if (state->mode != GZ_READ ||
|
||||
(state->err != Z_OK && state->err != Z_BUF_ERROR))
|
||||
|
Loading…
Reference in New Issue
Block a user