summaryrefslogtreecommitdiff
path: root/source3/lib/util_str.c
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>2005-12-27 20:52:36 +0000
committerGerald (Jerry) Carter <jerry@samba.org>2007-10-10 11:05:58 -0500
commit5a4881bf396e691524329bcd6aa1ae4a7f4084ec (patch)
treeea2cce14847e28629ec48f2a70f547bdbb08fe98 /source3/lib/util_str.c
parentd186ff50721011f839a02aaac4866201eda23034 (diff)
downloadsamba-5a4881bf396e691524329bcd6aa1ae4a7f4084ec.tar.gz
samba-5a4881bf396e691524329bcd6aa1ae4a7f4084ec.tar.bz2
samba-5a4881bf396e691524329bcd6aa1ae4a7f4084ec.zip
r12522: Try and fix bug #2926 by removing setlocale(LC_ALL, "C")
and replace calls to isupper/islower/toupper/tolower with ASCII equivalents (mapping into _w variants). Jeremy. (This used to be commit c2752347eb2deeb2798c580ec7fc751a847717e9)
Diffstat (limited to 'source3/lib/util_str.c')
-rw-r--r--source3/lib/util_str.c16
1 files changed, 8 insertions, 8 deletions
diff --git a/source3/lib/util_str.c b/source3/lib/util_str.c
index 80bb2ff2ad..0b02487f77 100644
--- a/source3/lib/util_str.c
+++ b/source3/lib/util_str.c
@@ -201,8 +201,8 @@ int StrCaseCmp(const char *s, const char *t)
/* not ascii anymore, do it the hard way from here on in */
break;
- us = toupper(*ps);
- ut = toupper(*pt);
+ us = toupper_ascii(*ps);
+ ut = toupper_ascii(*pt);
if (us == ut)
continue;
else if (us < ut)
@@ -309,7 +309,7 @@ int strwicmp(const char *psz1, const char *psz2)
psz1++;
while (isspace((int)*psz2))
psz2++;
- if (toupper(*psz1) != toupper(*psz2) || *psz1 == '\0'
+ if (toupper_ascii(*psz1) != toupper_ascii(*psz2) || *psz1 == '\0'
|| *psz2 == '\0')
break;
psz1++;
@@ -680,7 +680,7 @@ char *alpha_strcpy_fn(const char *fn, int line, char *dest, const char *src, con
for(i = 0; i < len; i++) {
int val = (src[i] & 0xff);
- if (isupper(val) || islower(val) || isdigit(val) || strchr_m(other_safe_chars, val))
+ if (isupper_ascii(val) || islower_ascii(val) || isdigit(val) || strchr_m(other_safe_chars, val))
dest[i] = src[i];
else
dest[i] = '_';
@@ -774,12 +774,12 @@ size_t strhex_to_str(char *p, size_t len, const char *strhex)
continue;
}
- if (!(p1 = strchr_m(hexchars, toupper(strhex[i]))))
+ if (!(p1 = strchr_m(hexchars, toupper_ascii(strhex[i]))))
break;
i++; /* next hex digit */
- if (!(p2 = strchr_m(hexchars, toupper(strhex[i]))))
+ if (!(p2 = strchr_m(hexchars, toupper_ascii(strhex[i]))))
break;
/* get the two nybbles */
@@ -1510,7 +1510,7 @@ void strlower_m(char *s)
(ie. they match for the first 128 chars) */
while (*s && !(((unsigned char)s[0]) & 0x80)) {
- *s = tolower((unsigned char)*s);
+ *s = tolower_ascii((unsigned char)*s);
s++;
}
@@ -1544,7 +1544,7 @@ void strupper_m(char *s)
(ie. they match for the first 128 chars) */
while (*s && !(((unsigned char)s[0]) & 0x80)) {
- *s = toupper((unsigned char)*s);
+ *s = toupper_ascii((unsigned char)*s);
s++;
}