Remove entries from the accept list as they are matched so we can determine if any files that were specified in the list wernt found.

This commit is contained in:
Glenn L McGrath
2002-10-19 02:18:51 +00:00
parent 98f824aa22
commit 25bca9566d
2 changed files with 14 additions and 0 deletions

View File

@@ -6,10 +6,18 @@
*/
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;
}
return(EXIT_FAILURE);