summaryrefslogtreecommitdiffstats
path: root/lib/libarchive/archive_read.c
diff options
context:
space:
mode:
Diffstat (limited to 'lib/libarchive/archive_read.c')
-rw-r--r--lib/libarchive/archive_read.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/lib/libarchive/archive_read.c b/lib/libarchive/archive_read.c
index 1d8f86d..5a1c114 100644
--- a/lib/libarchive/archive_read.c
+++ b/lib/libarchive/archive_read.c
@@ -126,8 +126,6 @@ archive_read_open(struct archive *a, void *client_data,
a->client_closer = closer;
a->client_data = client_data;
- a->state = ARCHIVE_STATE_HEADER;
-
/* Open data source. */
if (a->client_opener != NULL) {
e =(a->client_opener)(a, a->client_data);
@@ -156,6 +154,10 @@ archive_read_open(struct archive *a, void *client_data,
/* Initialize decompression routine with the first block of data. */
e = (a->decompressors[high_bidder].init)(a, buffer, bytes_read);
+
+ if (e == ARCHIVE_OK)
+ a->state = ARCHIVE_STATE_HEADER;
+
return (e);
}
OpenPOWER on IntegriCloud