diff options
author | Yang Tse <yangsita@gmail.com> | 2008-09-15 00:32:08 +0000 |
---|---|---|
committer | Yang Tse <yangsita@gmail.com> | 2008-09-15 00:32:08 +0000 |
commit | 4c621bc697b13472eeb90202f42b2a183b629e42 (patch) | |
tree | 7d87381c798bde41737ea9e6065e2a1751d11f19 /lib/strequal.c | |
parent | 938458b330370fc4321051524637334da62476a8 (diff) | |
download | curl-4c621bc697b13472eeb90202f42b2a183b629e42.tar.gz |
improve detection of:
strcasecmp()
strcasestr()
strcmpi()
stricmp()
strlcat()
strncasecmp()
strncmpi()
strnicmp()
Diffstat (limited to 'lib/strequal.c')
-rw-r--r-- | lib/strequal.c | 19 |
1 files changed, 4 insertions, 15 deletions
diff --git a/lib/strequal.c b/lib/strequal.c index 639a7ffc2..ac9075d58 100644 --- a/lib/strequal.c +++ b/lib/strequal.c @@ -5,7 +5,7 @@ * | (__| |_| | _ <| |___ * \___|\___/|_| \_\_____| * - * Copyright (C) 1998 - 2007, Daniel Stenberg, <daniel@haxx.se>, et al. + * Copyright (C) 1998 - 2008, Daniel Stenberg, <daniel@haxx.se>, et al. * * This software is licensed as described in the file COPYING, which * you should have received as part of this distribution. The terms @@ -21,11 +21,6 @@ * $Id$ ***************************************************************************/ -#ifndef _GNU_SOURCE -/* glibc needs this to define the prototype for strcasestr */ -#define _GNU_SOURCE 1 -#endif - #include "setup.h" #include <string.h> @@ -37,12 +32,6 @@ #include "strequal.h" -#if defined(HAVE_STRCASECMP) && defined(__STRICT_ANSI__) -/* this is for "-ansi -Wall -pedantic" to stop complaining! */ -extern int (strcasecmp)(const char *s1, const char *s2); -extern int (strncasecmp)(const char *s1, const char *s2, size_t n); -#endif - int curl_strequal(const char *first, const char *second) { #if defined(HAVE_STRCASECMP) @@ -65,11 +54,11 @@ int curl_strequal(const char *first, const char *second) int curl_strnequal(const char *first, const char *second, size_t max) { -#if defined(HAVE_STRCASECMP) +#if defined(HAVE_STRNCASECMP) return !strncasecmp(first, second, max); -#elif defined(HAVE_STRCMPI) +#elif defined(HAVE_STRNCMPI) return !strncmpi(first, second, max); -#elif defined(HAVE_STRICMP) +#elif defined(HAVE_STRNICMP) return !strnicmp(first, second, max); #else while(*first && *second && max) { |