From 5591550167092c0e5f307b3c2c87f44518e7159f Mon Sep 17 00:00:00 2001 From: Dan Fandrich Date: Wed, 21 Jan 2009 04:42:47 +0000 Subject: Fixed a couple more locale-dependent toupper conversions, mainly for clarity. This does fix one problem that causes ;type=i FTP URLs to fail in the Turkish locale when CURLOPT_PROXY_TRANSFER_MODE is used (test case 561) Added tests 561 and 1092 through 1094 to test various combinations of ;type= and ;mode= URLs that could potentially fail in the Turkish locale. --- lib/rawstr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) (limited to 'lib/rawstr.c') diff --git a/lib/rawstr.c b/lib/rawstr.c index b0fe38b26..795342338 100644 --- a/lib/rawstr.c +++ b/lib/rawstr.c @@ -25,9 +25,9 @@ #include "rawstr.h" -/* Portable toupper (remember EBCDIC). Do not use tupper() because +/* Portable, consistent toupper (remember EBCDIC). Do not use toupper() because its behavior is altered by the current locale. */ -static unsigned char my_toupper(unsigned char in) +char Curl_raw_toupper(char in) { switch (in) { case 'a': @@ -98,7 +98,7 @@ static unsigned char my_toupper(unsigned char in) int Curl_raw_equal(const char *first, const char *second) { while(*first && *second) { - if(my_toupper(*first) != my_toupper(*second)) + if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) /* get out of the loop as soon as they don't match */ break; first++; @@ -107,13 +107,13 @@ int Curl_raw_equal(const char *first, const char *second) /* we do the comparison here (possibly again), just to make sure that if the loop above is skipped because one of the strings reached zero, we must not return this as a successful match */ - return (my_toupper(*first) == my_toupper(*second)); + return (Curl_raw_toupper(*first) == Curl_raw_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)) { + if(Curl_raw_toupper(*first) != Curl_raw_toupper(*second)) { break; } max--; @@ -123,6 +123,6 @@ int Curl_raw_nequal(const char *first, const char *second, size_t max) if(0 == max) return 1; /* they are equal this far */ - return my_toupper(*first) == my_toupper(*second); + return Curl_raw_toupper(*first) == Curl_raw_toupper(*second); } -- cgit v1.2.3