commit 4b57020975f73d8c07712c7d26151f50205df436 from: Stefan Sperling date: Wed Mar 18 16:11:28 2020 UTC revert a change to inflate_read() from Ori's patch; it breaks got-read-blob commit - 2793759294c2ec8056c179cf87f7158101cae15d commit + 4b57020975f73d8c07712c7d26151f50205df436 blob - b72db6aaa7fa5c47899a453ee52a55222314cd79 blob + 472aaa11edacfa2b14007043174136b80ff00ba9 --- lib/inflate.c +++ lib/inflate.c @@ -86,16 +86,12 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t last_total_out = zb->z.total_out; z_stream *z = &zb->z; int ret = Z_ERRNO; - off_t off, consumed; z->next_out = zb->outbuf; z->avail_out = zb->outlen; *outlenp = 0; - off = ftello(f); - consumed = 0; do { - size_t last_total_in = zb->z.total_in; if (z->avail_in == 0) { size_t n = fread(zb->inbuf, 1, zb->inlen, f); if (n == 0) { @@ -109,7 +105,6 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, z->avail_in = n; } ret = inflate(z, Z_SYNC_FLUSH); - consumed += z->total_in - last_total_in; } while (ret == Z_OK && z->avail_out > 0); if (ret == Z_OK || ret == Z_BUF_ERROR) { @@ -121,7 +116,6 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, } *outlenp = z->total_out - last_total_out; - fseek(f, off + consumed, SEEK_SET); return NULL; }