diff avstring.c @ 860:536c2e94defa libavutil

Add av_stristr() function This is a case-insensitive version of strstr().
author mru
date Sat, 06 Mar 2010 19:41:22 +0000
parents 0f0768396e60
children 7d79d41d152e
line wrap: on
line diff
--- a/avstring.c	Sat Mar 06 14:24:59 2010 +0000
+++ b/avstring.c	Sat Mar 06 19:41:22 2010 +0000
@@ -48,6 +48,19 @@
     return !*pfx;
 }
 
+char *av_stristr(const char *s1, const char *s2)
+{
+    if (!*s2)
+        return s1;
+
+    do {
+        if (av_stristart(s1, s2, NULL))
+            return s1;
+    } while (*s1++);
+
+    return NULL;
+}
+
 size_t av_strlcpy(char *dst, const char *src, size_t size)
 {
     size_t len = 0;