diff options
Diffstat (limited to 'src/ustar.c')
-rw-r--r-- | src/ustar.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/ustar.c b/src/ustar.c index 21d41eb..d728cf5 100644 --- a/src/ustar.c +++ b/src/ustar.c @@ -17,6 +17,7 @@ * along with opkg-opk. If not, see <http://www.gnu.org/licenses/>. */ +#include <stdarg.h> #include <stdint.h> #include <stdio.h> #include <stdlib.h> @@ -128,10 +129,13 @@ opkg_opk_ustar_list(struct opkg_opk_ustar *ustar, } int -opkg_opk_ustar_seek(struct opkg_opk_ustar *ustar, const char *member) +opkg_opk_ustar_seek(struct opkg_opk_ustar *ustar, int num_keys, ...) { static struct _opkg_opk_ustar_header header; static unsigned char name[OPKG_OPK_USTAR_NAME_MAX_LEN]; + va_list ap; + int key; + const char *member; for (;;) { if (_opkg_opk_ustar_next(ustar, &header) != OPKG_OPK_OK) { @@ -146,9 +150,14 @@ opkg_opk_ustar_seek(struct opkg_opk_ustar *ustar, const char *member) name[sizeof(header.name)] = '\0'; } - if (strcmp((char *) name, member) == 0) { - return OPKG_OPK_OK; /* Member found */ + va_start(ap, num_keys); + for (key = 0; key < num_keys; ++key) { + member = va_arg(ap, const char *); + if (strcmp((char *) name, member) == 0) { + return OPKG_OPK_OK; /* Member found */ + } } + va_end(ap); while (ustar->data_size_remaining > 0) { if (opkg_opk_ustar_read(ustar, NULL, NULL) == |