summaryrefslogtreecommitdiff
path: root/libbb/llist.c
diff options
context:
space:
mode:
Diffstat (limited to 'libbb/llist.c')
-rw-r--r--libbb/llist.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/libbb/llist.c b/libbb/llist.c
index 5ba7f60..51b1ce6 100644
--- a/libbb/llist.c
+++ b/libbb/llist.c
@@ -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;
+}