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.
This commit is contained in:
Dan Fandrich 2009-01-21 04:42:47 +00:00
parent 6bb9ef8de4
commit 5591550167
17 changed files with 314 additions and 27 deletions

View file

@ -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);
}