diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-10-19 10:19:22 +0400 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-10-19 10:19:22 +0400 |
commit | c5c1a8a112ebae29862a902e6e511b392c59da74 (patch) | |
tree | 88df433818b25262966b84fa81aecde8b75c8ed1 /archival/libunarchive/filter_accept_list.c | |
parent | 05fa661123d90b990c146ef6d79da82d798ccd6f (diff) |
Fix exclude/include problem
Diffstat (limited to 'archival/libunarchive/filter_accept_list.c')
-rw-r--r-- | archival/libunarchive/filter_accept_list.c | 19 |
1 files changed, 5 insertions, 14 deletions
diff --git a/archival/libunarchive/filter_accept_list.c b/archival/libunarchive/filter_accept_list.c index 9f92e6440..2b023ec70 100644 --- a/archival/libunarchive/filter_accept_list.c +++ b/archival/libunarchive/filter_accept_list.c @@ -1,24 +1,15 @@ #include <fnmatch.h> #include <stdlib.h> #include "unarchive.h" + /* * Accept names that are in the accept list */ extern char filter_accept_list(const llist_t *accept_list, const llist_t *reject_list, const char *key) { - llist_t *accept_old; - - while (accept_list) { - if (fnmatch(accept_list->data, key, 0) == 0) { - /* Remove entry from list */ - accept_old->link = accept_list->link; - free(accept_list->data); - free(accept_list); - accept_list = accept_old; - return(EXIT_SUCCESS); - } - accept_old = accept_list; - accept_list = accept_list->link; + if (find_list_entry(accept_list, key)) { + return(EXIT_SUCCESS); + } else { + return(EXIT_FAILURE); } - return(EXIT_FAILURE); } |