From 9dc94f8ab86d80735e4c8999bde1e2dd4f42476d Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Sat, 28 May 2005 08:47:01 +0000 Subject: [PATCH] r7052: added a case insensitive str_list_check_ci() version of str_list_check() (This used to be commit 5654330b6100a7291cee3631815cfb898100cf23) --- source4/lib/util_strlist.c | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/source4/lib/util_strlist.c b/source4/lib/util_strlist.c index 3b949f6eef1..d5c4d915850 100644 --- a/source4/lib/util_strlist.c +++ b/source4/lib/util_strlist.c @@ -173,3 +173,16 @@ BOOL str_list_check(const char **list, const char *s) } return False; } + +/* + return True if a string is in a list, case insensitively +*/ +BOOL str_list_check_ci(const char **list, const char *s) +{ + int i; + + for (i=0;list[i];i++) { + if (strcasecmp(list[i], s) == 0) return True; + } + return False; +}