libarchive: open_zipped() does not need to check extensions for e.g. gzip
[oweals/busybox.git] / libbb / llist.c
index 5ba7f6047a98b5eb608509f4c851cd2fe0c5a3ee..032e9fac8e580d2637b72757240323cdd3d77c91 100644 (file)
@@ -7,7 +7,7 @@
  * Copyright (C) 2005 Bernhard Reutner-Fischer
  * Copyright (C) 2006 Rob Landley <rob@landley.net>
  *
- * Licensed under the GPL v2 or later, see the file LICENSE in this tarball.
+ * Licensed under GPLv2 or later, see file LICENSE in this source tree.
  */
 
 #include "libbb.h"
@@ -62,7 +62,7 @@ void FAST_FUNC llist_unlink(llist_t **head, llist_t *elm)
 
 /* Recursively free all elements in the linked list.  If freeit != NULL
  * call it on each datum in the list */
-void FAST_FUNC llist_free(llist_t *elm, void (*freeit) (void *data))
+void FAST_FUNC llist_free(llist_t *elm, void (*freeit)(void *data))
 {
        while (elm) {
                void *data = llist_pop(&elm);
@@ -86,3 +86,13 @@ llist_t* FAST_FUNC llist_rev(llist_t *list)
        }
        return rev;
 }
+
+llist_t* FAST_FUNC llist_find_str(llist_t *list, const char *str)
+{
+       while (list) {
+               if (strcmp(list->data, str) == 0)
+                       break;
+               list = list->link;
+       }
+       return list;
+}