summaryrefslogtreecommitdiff
path: root/src/common/weechat.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/common/weechat.c')
-rw-r--r--src/common/weechat.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/common/weechat.c b/src/common/weechat.c
index 76d426aa0..7e99ae250 100644
--- a/src/common/weechat.c
+++ b/src/common/weechat.c
@@ -196,6 +196,31 @@ ascii_strncasecmp (char *string1, char *string2, int max)
}
/*
+ * ascii_strcasestr: locale and case independent string search
+ */
+
+char *
+ascii_strcasestr (char *string, char *search)
+{
+ int length_search;
+
+ length_search = strlen (search);
+
+ if (!string || !search || (length_search == 0))
+ return NULL;
+
+ while (string[0])
+ {
+ if (ascii_strncasecmp (string, search, length_search) == 0)
+ return string;
+
+ string++;
+ }
+
+ return NULL;
+}
+
+/*
* weechat_iconv: convert string to another charset
*/