less: document -S flag and make it independently configurable
[oweals/busybox.git] / archival / libarchive / filter_accept_reject_list.c
index 3e86cca65420f528b7669a90a63239ac62f01400..2483749417d7507c53034df0376ecbb87d7ddab8 100644 (file)
@@ -6,7 +6,7 @@
  */
 
 #include "libbb.h"
-#include "archive.h"
+#include "bb_archive.h"
 
 /*
  * Accept names that are in the accept list and not in the reject list
@@ -24,11 +24,13 @@ char FAST_FUNC filter_accept_reject_list(archive_handle_t *archive_handle)
        if (reject_entry) {
                return EXIT_FAILURE;
        }
-       accept_entry = find_list_entry2(archive_handle->accept, key);
 
        /* Fail if an accept list was specified and the key wasnt in there */
-       if ((accept_entry == NULL) && archive_handle->accept) {
-               return EXIT_FAILURE;
+       if (archive_handle->accept) {
+               accept_entry = find_list_entry2(archive_handle->accept, key);
+               if (!accept_entry) {
+                       return EXIT_FAILURE;
+               }
        }
 
        /* Accepted */