Commit a2b6127 for zlib
commit a2b61271a362d4881b9f67fb92455f4fbbab06df
Author: Mark Adler <madler@alumni.caltech.edu>
Date: Mon May 12 10:06:03 2025 -0700
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.
diff --git a/gzwrite.c b/gzwrite.c
index ef9ffee..1fd2046 100644
--- a/gzwrite.c
+++ b/gzwrite.c
@@ -88,8 +88,9 @@ local int gz_comp(gz_statep state, int flush) {
/* check for a pending reset */
if (state->reset) {
- /* don't start a new gzip member unless there is data to write */
- if (strm->avail_in == 0)
+ /* don't start a new gzip member unless there is data to write and
+ we're not flushing */
+ if (strm->avail_in == 0 && flush == Z_NO_FLUSH)
return 0;
deflateReset(strm);
state->reset = 0;