summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ustar.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/src/ustar.c b/src/ustar.c
index c616ac8..7f9666a 100644
--- a/src/ustar.c
+++ b/src/ustar.c
@@ -58,11 +58,16 @@ _opkg_opk_ustar_next(struct opkg_opk_gzip_state *gzip_state, const char *member,
switch ((ret = opkg_opk_gzip_next_record(gzip_state, header))) {
case OPKG_OPK_OK:
- case OPKG_OPK_END:
break;
+ case OPKG_OPK_END:
case OPKG_OPK_ERROR:
return OPKG_OPK_ERROR;
}
+ memset(record, 0, 512);
+ if (strncmp(header, record, 512) == 0) {
+ /* TODO: End gzip stream */
+ return OPKG_OPK_END;
+ }
if (strncmp(header->magic, "ustar", strlen("ustar")) != 0) {
return OPKG_OPK_ERROR;
}
@@ -74,8 +79,8 @@ _opkg_opk_ustar_next(struct opkg_opk_gzip_state *gzip_state, const char *member,
for (i = 0; i < (size + 511) / 512; ++i) {
switch ((ret = opkg_opk_gzip_next_record(gzip_state, record))) {
case OPKG_OPK_OK:
- case OPKG_OPK_END:
break;
+ case OPKG_OPK_END:
case OPKG_OPK_ERROR:
return OPKG_OPK_ERROR;
}