Code

support: removed fallback strcasestr() implementation
authorMax Kellermann <max@duempel.org>
Wed, 10 Dec 2008 18:47:56 +0000 (19:47 +0100)
committerMax Kellermann <max@duempel.org>
Wed, 10 Dec 2008 18:47:56 +0000 (19:47 +0100)
The code which used to call strcasestr() has been converted to
match_line().

configure.ac
src/support.c
src/support.h

index e85570bd4bef1c07ef75778245c3620eb239e4bd..ebc19fdeaddec6467b9d795fc4a1d2fca16fd176 100644 (file)
@@ -27,12 +27,6 @@ AC_CHECK_HEADER([locale.h],
                ,)
 
 
-dnl
-dnl Check for functions
-dnl
-AC_CHECK_FUNCS([strcasestr])
-
-
 dnl
 dnl ncmpc-mini
 dnl
index 68dc558873cff4830e0ffabd9e7cb827864bdf72..3dbebd0e12f0bd5bb1fb06a1dbec1774835b88ef 100644 (file)
 #include <ctype.h>
 #include <string.h>
 
-#ifndef HAVE_STRCASESTR
-const char *
-strcasestr(const char *haystack, const char *needle)
-{
-       char *haystack2 = g_utf8_strdown(haystack, -1);
-       char *needle2 = g_utf8_strdown(needle, -1);
-       char *result;
-
-       assert(haystack != NULL);
-       assert(needle != NULL);
-
-       result = strstr(haystack2, needle2);
-       g_free(haystack2);
-       g_free(needle2);
-
-       return haystack + (result - haystack2);
-}
-#endif /* HAVE_STRCASESTR */
-
 #ifndef NCMPC_MINI
 
 // FIXME: utf-8 length
index bebbbdad0c60fa05762fb9d8230b763135e5984e..4886292362d0e4651badfc57c1ecb48dc5bdec2d 100644 (file)
 
 #include <glib.h>
 
-#ifndef HAVE_STRCASESTR
-const char *strcasestr(const char *haystack, const char *needle);
-#endif
-
 #ifndef NCMPC_MINI
 
 typedef struct {