From a579d6706436615845f57692921e0891fb6e3719 Mon Sep 17 00:00:00 2001 From: Daniel Stenberg Date: Wed, 15 Oct 2008 21:43:48 +0000 Subject: - Pascal Terjan filed bug #2154627 (http://curl.haxx.se/bug/view.cgi?id=2154627) which pointed out that libcurl uses strcasecmp() in multiple places where it causes failures when the Turkish locale is used. This is because 'i' and 'I' isn't the same letter so strcasecmp() on those letters are different in Turkish than in English (or just about all other languages). I thus introduced a totally new internal function in libcurl (called Curl_ascii_equal) for doing case insentive comparisons for english-(ascii?) style strings that thus will make "file" and "FILE" match even if the Turkish locale is selected. --- lib/ssluse.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'lib/ssluse.c') diff --git a/lib/ssluse.c b/lib/ssluse.c index d0f5501fe..1c47508ef 100644 --- a/lib/ssluse.c +++ b/lib/ssluse.c @@ -284,13 +284,13 @@ static int do_file_type(const char *type) { if(!type || !type[0]) return SSL_FILETYPE_PEM; - if(curl_strequal(type, "PEM")) + if(Curl_ascii_equal(type, "PEM")) return SSL_FILETYPE_PEM; - if(curl_strequal(type, "DER")) + if(Curl_ascii_equal(type, "DER")) return SSL_FILETYPE_ASN1; - if(curl_strequal(type, "ENG")) + if(Curl_ascii_equal(type, "ENG")) return SSL_FILETYPE_ENGINE; - if(curl_strequal(type, "P12")) + if(Curl_ascii_equal(type, "P12")) return SSL_FILETYPE_PKCS12; return -1; } @@ -1010,7 +1010,7 @@ cert_hostcheck(const char *match_pattern, const char *hostname) !hostname || !*hostname) /* sanity check */ return 0; - if(curl_strequal(hostname,match_pattern)) /* trivial case */ + if(Curl_ascii_equal(hostname, match_pattern)) /* trivial case */ return 1; if(hostmatch(hostname,match_pattern) == HOST_MATCH) -- cgit v1.2.3