summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/ustar.c16
1 files changed, 6 insertions, 10 deletions
diff --git a/src/ustar.c b/src/ustar.c
index 0a508f5..a77dace 100644
--- a/src/ustar.c
+++ b/src/ustar.c
@@ -132,11 +132,9 @@ opkg_opk_ustar_seek(struct opkg_opk_ustar *ustar, const char *member)
{
static struct _opkg_opk_ustar_header header;
static unsigned char name[OPKG_OPK_USTAR_NAME_MAX_LEN];
- int ret;
for (;;) {
- if ((ret =_opkg_opk_ustar_next(ustar, &header)) != OPKG_OPK_OK)
- {
+ if (_opkg_opk_ustar_next(ustar, &header) != OPKG_OPK_OK) {
return OPKG_OPK_ERROR; /* Error or end (not found) */
}
@@ -148,21 +146,19 @@ opkg_opk_ustar_seek(struct opkg_opk_ustar *ustar, const char *member)
name[sizeof(header.name)] = '\0';
}
- if (strcmp((char *) name, member) == 0) {
- ret = OPKG_OPK_OK; /* Member found */
- } else {
- ret = OPKG_OPK_ERROR; /* Member not found (yet) */
- }
-
while (ustar->data_size_remaining > 0) {
if (opkg_opk_ustar_read(ustar, NULL, NULL) ==
OPKG_OPK_ERROR) {
return OPKG_OPK_ERROR;
}
}
+
+ if (strcmp((char *) name, member) == 0) {
+ return OPKG_OPK_OK; /* Member found */
+ }
}
- return ret;
+ return OPKG_OPK_ERROR; /* Member not found */
}
int