X-Git-Url: https://git.lizzy.rs/?a=blobdiff_plain;f=gzlib.c;h=ced2cb8ba74096377051f98892479ee95b537c73;hb=72c70060d8312cff06754779188d8adeb974f18c;hp=fae202ef8905a3c99e4b71d756a45d55f9b1c163;hpb=0b166094092efa2b92200cbb67f390e86c181ab4;p=zlib.git 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) free(state); return NULL; } - if (state->mode == GZ_APPEND) + if (state->mode == GZ_APPEND) { + LSEEK(state->fd, 0, SEEK_END); /* so gzoffset() is correct */ state->mode = GZ_WRITE; /* simplify later checks */ + } /* save the current position for rewinding (only if reading) */ if (state->mode == GZ_READ) {