]> git.lizzy.rs Git - zlib.git/blobdiff - gzlib.c
Avoid adding empty gzip member after gzflush with Z_FINISH.
[zlib.git] / gzlib.c
diff --git a/gzlib.c b/gzlib.c
index 4838bf04745beb5722fa4c69436ccc9d3fae68fb..f6b3b406e64f75e1925998db8a747eb69d67fc48 100644 (file)
--- a/gzlib.c
+++ b/gzlib.c
@@ -81,6 +81,8 @@ local void gz_reset(state)
         state->past = 0;            /* have not read past end yet */
         state->how = LOOK;          /* look for gzip header */
     }
+    else                            /* for writing ... */
+        state->reset = 0;           /* no deflateReset pending */
     state->seek = 0;                /* no seek request pending */
     gz_error(state, Z_OK, NULL);    /* clear error */
     state->x.pos = 0;               /* no uncompressed data yet */