From 0b791d9a976e46b2705ae73046706ab9ac3768be Mon Sep 17 00:00:00 2001 From: Denis Vlasenko Date: Mon, 13 Apr 2009 20:52:00 +0000 Subject: move llist_find_str from modutils to libbb --- libbb/llist.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'libbb') diff --git a/libbb/llist.c b/libbb/llist.c index 5ba7f6047..51b1ce6c9 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; +} -- cgit v1.2.3-55-g6feb