From bab5183820dbd2e0ea9ee4f0442844291d05c90e Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Thu, 23 Oct 2008 01:20:57 +0000 Subject: Created Curl_raw_nequal() which does a C-locale string case comparison. Changed checkprefix() to use it and those instances of strnequal() that compare host names or other protocol strings that are defined to be independent of case in the C locale. This should fix a few more Turkish locale problems. --- lib/strequal.c | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'lib/strequal.c') diff --git a/lib/strequal.c b/lib/strequal.c index 5065b3871..3d00aa213 100644 --- a/lib/strequal.c +++ b/lib/strequal.c @@ -161,6 +161,22 @@ int Curl_raw_equal(const char *first, const char *second) return (my_toupper(*first) == my_toupper(*second)); } +int Curl_raw_nequal(const char *first, const char *second, size_t max) +{ + while(*first && *second && max) { + if(my_toupper(*first) != my_toupper(*second)) { + break; + } + max--; + first++; + second++; + } + if(0 == max) + return 1; /* they are equal this far */ + + return my_toupper(*first) == my_toupper(*second); +} + #ifndef HAVE_STRLCAT /* * The strlcat() function appends the NUL-terminated string src to the end -- cgit v1.2.3