diff options
| -rw-r--r-- | gzread.c | 12 |
1 files changed, 6 insertions, 6 deletions
| @@ -569,14 +569,14 @@ char * ZEXPORT gzgets(file, buf, len) | |||
| 569 | left = (unsigned)len - 1; | 569 | left = (unsigned)len - 1; |
| 570 | if (left) do { | 570 | if (left) do { |
| 571 | /* assure that something is in the output buffer */ | 571 | /* assure that something is in the output buffer */ |
| 572 | if (state->have == 0) { | 572 | while (state->have == 0 && (state->strm.avail_in || !state->eof)) { |
| 573 | if (gz_make(state) == -1) | 573 | if (gz_make(state) == -1) |
| 574 | return NULL; /* error */ | 574 | return NULL; /* error */ |
| 575 | if (state->have == 0) { /* end of file */ | 575 | } |
| 576 | if (buf == str) /* got bupkus */ | 576 | if (state->have == 0) { /* end of file */ |
| 577 | return NULL; | 577 | if (buf == str) /* got bupkus */ |
| 578 | break; /* got something -- return it */ | 578 | return NULL; |
| 579 | } | 579 | break; /* got something -- return it */ |
| 580 | } | 580 | } |
| 581 | 581 | ||
| 582 | /* look for end-of-line in current output buffer */ | 582 | /* look for end-of-line in current output buffer */ |
