aboutsummaryrefslogtreecommitdiff
path: root/lib/tar/src/iterator.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/tar/src/iterator.c')
-rw-r--r--lib/tar/src/iterator.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/tar/src/iterator.c b/lib/tar/src/iterator.c
index 0940905..532eb8c 100644
--- a/lib/tar/src/iterator.c
+++ b/lib/tar/src/iterator.c
@@ -104,6 +104,12 @@ static int strm_precache(istream_t *strm)
tar_istream_t *tar = (tar_istream_t *)strm;
sqfs_u64 diff;
+ strm->buffer_used -= strm->buffer_offset;
+ strm->buffer_offset = 0;
+
+ if (strm->eof)
+ return 0;
+
tar->parent->offset += tar->parent->last_chunk;
if (!tar->parent->last_sparse) {