revert a change to inflate_read() from Ori's patch; it breaks got-read-blob
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
diff --git a/lib/inflate.c b/lib/inflate.c
index b72db6a..472aaa1 100644
--- a/lib/inflate.c
+++ b/lib/inflate.c
@@ -86,16 +86,12 @@ got_inflate_read(struct got_inflate_buf *zb, FILE *f, size_t *outlenp)
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, size_t *outlenp)
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, size_t *outlenp)
}
*outlenp = z->total_out - last_total_out;
- fseek(f, off + consumed, SEEK_SET);
return NULL;
}