aboutsummaryrefslogtreecommitdiff
path: root/lib/rawstr.c
diff options
context:
space:
mode:
authorDan Fandrich <dan@coneharvesters.com>2009-01-21 04:42:47 +0000
committerDan Fandrich <dan@coneharvesters.com>2009-01-21 04:42:47 +0000
commit5591550167092c0e5f307b3c2c87f44518e7159f (patch)
tree7fc43fd73fc132099fc7a9c6c740484ad29d4c82 /lib/rawstr.c
parent6bb9ef8de4273e0f5f5e499eb61a972b3644f70f (diff)
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.
Diffstat (limited to 'lib/rawstr.c')
-rw-r--r--lib/rawstr.c12
1 files changed, 6 insertions, 6 deletions
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);
}