diff options
| author | Mark Adler <madler@alumni.caltech.edu> | 2025-05-12 10:06:03 -0700 |
|---|---|---|
| committer | Mark Adler <git@madler.net> | 2025-12-06 17:39:44 -0800 |
| commit | a2b61271a362d4881b9f67fb92455f4fbbab06df (patch) | |
| tree | af80d97f3fca2f95408201bbae97546a1865afbb | |
| parent | 95278e4ef9de87294dea0c94184bd8fe4316c3a9 (diff) | |
| download | zlib-a2b61271a362d4881b9f67fb92455f4fbbab06df.tar.gz zlib-a2b61271a362d4881b9f67fb92455f4fbbab06df.tar.bz2 zlib-a2b61271a362d4881b9f67fb92455f4fbbab06df.zip | |
Allow gzflush() to write empty gzip members.
Before this, a gzflush() with Z_FINISH and no data to write would
do nothing. Now it will write an empty gzip member.
| -rw-r--r-- | gzwrite.c | 5 |
1 files changed, 3 insertions, 2 deletions
| @@ -88,8 +88,9 @@ local int gz_comp(gz_statep state, int flush) { | |||
| 88 | 88 | ||
| 89 | /* check for a pending reset */ | 89 | /* check for a pending reset */ |
| 90 | if (state->reset) { | 90 | if (state->reset) { |
| 91 | /* don't start a new gzip member unless there is data to write */ | 91 | /* don't start a new gzip member unless there is data to write and |
| 92 | if (strm->avail_in == 0) | 92 | we're not flushing */ |
| 93 | if (strm->avail_in == 0 && flush == Z_NO_FLUSH) | ||
| 93 | return 0; | 94 | return 0; |
| 94 | deflateReset(strm); | 95 | deflateReset(strm); |
| 95 | state->reset = 0; | 96 | state->reset = 0; |
