tar: tar xf foo.tar dir/dir did not extract all subdirs.
[oweals/busybox.git] / archival / libunarchive / find_list_entry.c
1 /* vi: set sw=4 ts=4: */
2 /*
3  * Copyright (C) 2002 by Glenn McGrath
4  *
5  * Licensed under GPLv2 or later, see file LICENSE in this tarball for details.
6  */
7
8 #include <fnmatch.h>
9 #include <stdlib.h>
10 #include "unarchive.h"
11
12 /* Find a string in a list */
13 const llist_t *find_list_entry(const llist_t *list, const char *filename)
14 {
15         while (list) {
16                 if (fnmatch(list->data, filename, FNM_LEADING_DIR) == 0) {
17                         return (list);
18                 }
19                 list = list->link;
20         }
21         return(NULL);
22 }