From c4782007667a29b1a02f13108f9ec0017aa3cbc7 Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Tue, 25 Sep 2007 06:43:58 +0000 Subject: Use a native strcasestr() if found. --- configure.ac | 1 + lib/strequal.c | 4 ++++ 2 files changed, 5 insertions(+) diff --git a/configure.ac b/configure.ac index d93fc49cc..0a40e5595 100644 --- a/configure.ac +++ b/configure.ac @@ -1900,6 +1900,7 @@ AC_CHECK_FUNCS( strtoll \ select \ strdup \ strstr \ + strcasestr \ strtok_r \ uname \ strcasecmp \ diff --git a/lib/strequal.c b/lib/strequal.c index cb8767002..adf84403d 100644 --- a/lib/strequal.c +++ b/lib/strequal.c @@ -90,6 +90,9 @@ int curl_strnequal(const char *first, const char *second, size_t max) */ char *Curl_strcasestr(const char *haystack, const char *needle) { +#if defined(HAVE_STRCASESTR) + return strcasestr(haystack, needle); +#else size_t nlen = strlen(needle); size_t hlen = strlen(haystack); @@ -99,6 +102,7 @@ char *Curl_strcasestr(const char *haystack, const char *needle) haystack++; } return NULL; +#endif } #ifndef HAVE_STRLCAT -- cgit v1.2.3