diff options
| -rw-r--r-- | gzread.c | 4 |
1 files changed, 4 insertions, 0 deletions
| @@ -443,6 +443,10 @@ int ZEXPORT gzungetc(int c, gzFile file) { | |||
| 443 | return -1; | 443 | return -1; |
| 444 | state = (gz_statep)file; | 444 | state = (gz_statep)file; |
| 445 | 445 | ||
| 446 | /* in case this was just opened, set up the input buffer */ | ||
| 447 | if (state->mode == GZ_READ && state->how == LOOK && state->x.have == 0) | ||
| 448 | (void)gz_look(state); | ||
| 449 | |||
| 446 | /* check that we're reading and that there's no (serious) error */ | 450 | /* check that we're reading and that there's no (serious) error */ |
| 447 | if (state->mode != GZ_READ || | 451 | if (state->mode != GZ_READ || |
| 448 | (state->err != Z_OK && state->err != Z_BUF_ERROR)) | 452 | (state->err != Z_OK && state->err != Z_BUF_ERROR)) |
