diff options
author | Dan Fandrich <dan@coneharvesters.com> | 2008-10-23 01:20:57 +0000 |
---|---|---|
committer | Dan Fandrich <dan@coneharvesters.com> | 2008-10-23 01:20:57 +0000 |
commit | bab5183820dbd2e0ea9ee4f0442844291d05c90e (patch) | |
tree | 3d6ff5612852ebe99afe0d83d2419ef1909d7a5a /lib/strequal.c | |
parent | 0abaf2246777df3b06abc3430315d704c808ef4e (diff) | |
download | curl-bab5183820dbd2e0ea9ee4f0442844291d05c90e.tar.gz |
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.
Diffstat (limited to 'lib/strequal.c')
-rw-r--r-- | lib/strequal.c | 16 |
1 files changed, 16 insertions, 0 deletions
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 |