diff options
author | Glenn L McGrath <bug1@ihug.co.nz> | 2002-10-19 02:18:51 +0000 |
---|---|---|
committer | Glenn L McGrath <bug1@ihug.co.nz> | 2002-10-19 02:18:51 +0000 |
commit | 25bca9566d66f13e17220135d45bb0fa94d4ed9d (patch) | |
tree | dde4b6999b3be2380cc9adc499797f50dc72e85a | |
parent | 98f824aa227e99891d9e65780197122772ca4dc2 (diff) | |
download | busybox-w32-25bca9566d66f13e17220135d45bb0fa94d4ed9d.tar.gz busybox-w32-25bca9566d66f13e17220135d45bb0fa94d4ed9d.tar.bz2 busybox-w32-25bca9566d66f13e17220135d45bb0fa94d4ed9d.zip |
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.
-rw-r--r-- | archival/libunarchive/filter_accept_list.c | 8 | ||||
-rw-r--r-- | archival/tar.c | 6 |
2 files changed, 14 insertions, 0 deletions
diff --git a/archival/libunarchive/filter_accept_list.c b/archival/libunarchive/filter_accept_list.c index 06b1dd3dd..9f92e6440 100644 --- a/archival/libunarchive/filter_accept_list.c +++ b/archival/libunarchive/filter_accept_list.c | |||
@@ -6,10 +6,18 @@ | |||
6 | */ | 6 | */ |
7 | extern char filter_accept_list(const llist_t *accept_list, const llist_t *reject_list, const char *key) | 7 | extern char filter_accept_list(const llist_t *accept_list, const llist_t *reject_list, const char *key) |
8 | { | 8 | { |
9 | llist_t *accept_old; | ||
10 | |||
9 | while (accept_list) { | 11 | while (accept_list) { |
10 | if (fnmatch(accept_list->data, key, 0) == 0) { | 12 | if (fnmatch(accept_list->data, key, 0) == 0) { |
13 | /* Remove entry from list */ | ||
14 | accept_old->link = accept_list->link; | ||
15 | free(accept_list->data); | ||
16 | free(accept_list); | ||
17 | accept_list = accept_old; | ||
11 | return(EXIT_SUCCESS); | 18 | return(EXIT_SUCCESS); |
12 | } | 19 | } |
20 | accept_old = accept_list; | ||
13 | accept_list = accept_list->link; | 21 | accept_list = accept_list->link; |
14 | } | 22 | } |
15 | return(EXIT_FAILURE); | 23 | return(EXIT_FAILURE); |
diff --git a/archival/tar.c b/archival/tar.c index 993478a67..df110a149 100644 --- a/archival/tar.c +++ b/archival/tar.c | |||
@@ -717,6 +717,7 @@ int tar_main(int argc, char **argv) | |||
717 | 717 | ||
718 | #ifdef CONFIG_FEATURE_TAR_EXCLUDE | 718 | #ifdef CONFIG_FEATURE_TAR_EXCLUDE |
719 | if (tar_handle->reject) { | 719 | if (tar_handle->reject) { |
720 | printf("Reject list\n"); | ||
720 | tar_handle->filter = filter_accept_reject_list; | 721 | tar_handle->filter = filter_accept_reject_list; |
721 | } else | 722 | } else |
722 | #endif /* CONFIG_FEATURE_TAR_EXCLUDE */ | 723 | #endif /* CONFIG_FEATURE_TAR_EXCLUDE */ |
@@ -762,6 +763,11 @@ int tar_main(int argc, char **argv) | |||
762 | while (get_header_tar(tar_handle) == EXIT_SUCCESS); | 763 | while (get_header_tar(tar_handle) == EXIT_SUCCESS); |
763 | } | 764 | } |
764 | 765 | ||
766 | /* Skip through list */ | ||
767 | while (tar_handle->accept) { | ||
768 | error_msg_and_die("%s: Not found in archive\n", tar_handle->accept->data); | ||
769 | tar_handle->accept = tar_handle->accept->link; | ||
770 | } | ||
765 | #ifdef CONFIG_FEATURE_CLEAN_UP | 771 | #ifdef CONFIG_FEATURE_CLEAN_UP |
766 | if (tar_handle->src_fd != fileno(stdin)) { | 772 | if (tar_handle->src_fd != fileno(stdin)) { |
767 | close(tar_handle->src_fd); | 773 | close(tar_handle->src_fd); |