From c5c1a8a112ebae29862a902e6e511b392c59da74 Mon Sep 17 00:00:00 2001 From: Glenn L McGrath Date: Sat, 19 Oct 2002 06:19:22 +0000 Subject: Fix exclude/include problem --- archival/libunarchive/filter_accept_reject_list.c | 21 ++++++--------------- 1 file changed, 6 insertions(+), 15 deletions(-) (limited to 'archival/libunarchive/filter_accept_reject_list.c') diff --git a/archival/libunarchive/filter_accept_reject_list.c b/archival/libunarchive/filter_accept_reject_list.c index c893dfcfc..21fecf120 100644 --- a/archival/libunarchive/filter_accept_reject_list.c +++ b/archival/libunarchive/filter_accept_reject_list.c @@ -2,33 +2,24 @@ #include #include "unarchive.h" -static char check_list(const llist_t *list, const char *filename) -{ - if (list) { - while (list) { - if (fnmatch(list->data, filename, 0) == 0) { - return(EXIT_SUCCESS); - } - list = list->link; - } - } - return(EXIT_FAILURE); -} - /* * Accept names that are in the accept list */ extern char filter_accept_reject_list(const llist_t *accept_list, const llist_t *reject_list, const char *key) { + const llist_t *accept_entry = find_list_entry(accept_list, key); + const llist_t *reject_entry = find_list_entry(reject_list, key); + /* Fail if an accept list was specified and the key wasnt in there */ - if ((accept_list) && (check_list(accept_list, key) == EXIT_FAILURE)) { + if (accept_list && (accept_entry == NULL)) { return(EXIT_FAILURE); } /* If the key is in a reject list fail */ - if (check_list(reject_list, key) == EXIT_FAILURE) { + if (reject_entry) { return(EXIT_FAILURE); } + /* Accepted */ return(EXIT_SUCCESS); } -- cgit v1.2.3