aboutsummaryrefslogtreecommitdiff
path: root/gzlib.c
diff options
context:
space:
mode:
Diffstat (limited to 'gzlib.c')
-rw-r--r--gzlib.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/gzlib.c b/gzlib.c
index fae202e..ced2cb8 100644
--- a/gzlib.c
+++ b/gzlib.c
@@ -248,8 +248,10 @@ local gzFile gz_open(path, fd, mode)
248 free(state); 248 free(state);
249 return NULL; 249 return NULL;
250 } 250 }
251 if (state->mode == GZ_APPEND) 251 if (state->mode == GZ_APPEND) {
252 LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */
252 state->mode = GZ_WRITE; /* simplify later checks */ 253 state->mode = GZ_WRITE; /* simplify later checks */
254 }
253 255
254 /* save the current position for rewinding (only if reading) */ 256 /* save the current position for rewinding (only if reading) */
255 if (state->mode == GZ_READ) { 257 if (state->mode == GZ_READ) {