diff options
author | Jeremy Allison <jra@samba.org> | 2011-07-19 13:19:29 -0700 |
---|---|---|
committer | Jeremy Allison <jra@samba.org> | 2011-07-19 13:19:29 -0700 |
commit | ee34c25c8a989b5a7c0ad59d71bb39f8efff045c (patch) | |
tree | 25d8f09ed1c36ad18c8c54d596efeeb6c1aa66b2 /lib | |
parent | 2052c2d6fa830b94a6b6cf8dd48b56f62de4e5ac (diff) | |
download | samba-ee34c25c8a989b5a7c0ad59d71bb39f8efff045c.tar.gz samba-ee34c25c8a989b5a7c0ad59d71bb39f8efff045c.tar.bz2 samba-ee34c25c8a989b5a7c0ad59d71bb39f8efff045c.zip |
First part of fix for bug 8310 - toupper_ascii() is broken on big-endian systems
Remove
int toupper_ascii(int c);
int tolower_ascii(int c);
int isupper_ascii(int c);
int islower_ascii(int c);
and replace with their _m equivalents, as they are identical.
Diffstat (limited to 'lib')
-rw-r--r-- | lib/util/charset/charset.h | 4 | ||||
-rw-r--r-- | lib/util/charset/util_unistr_w.c | 38 | ||||
-rw-r--r-- | lib/util/util_str_common.c | 2 |
3 files changed, 1 insertions, 43 deletions
diff --git a/lib/util/charset/charset.h b/lib/util/charset/charset.h index b36c461003..08bb4533d2 100644 --- a/lib/util/charset/charset.h +++ b/lib/util/charset/charset.h @@ -257,10 +257,6 @@ int strcmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b); int strcasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b); int strncasecmp_w(const smb_ucs2_t *a, const smb_ucs2_t *b, size_t len); int strcmp_wa(const smb_ucs2_t *a, const char *b); -int toupper_ascii(int c); -int tolower_ascii(int c); -int isupper_ascii(int c); -int islower_ascii(int c); /* * Define stub for charset module which implements 8-bit encoding with gaps. diff --git a/lib/util/charset/util_unistr_w.c b/lib/util/charset/util_unistr_w.c index 3fbed7f67c..fc6d3747bd 100644 --- a/lib/util/charset/util_unistr_w.c +++ b/lib/util/charset/util_unistr_w.c @@ -252,41 +252,3 @@ int strcmp_wa(const smb_ucs2_t *a, const char *b) } return (*(COPY_UCS2_CHAR(&cp,a)) - UCS2_CHAR(*b)); } - -/************************************************************* - ascii only toupper - saves the need for smbd to be in C locale. -*************************************************************/ - -int toupper_ascii(int c) -{ - smb_ucs2_t uc = toupper_m(UCS2_CHAR(c)); - return UCS2_TO_CHAR(uc); -} - -/************************************************************* - ascii only tolower - saves the need for smbd to be in C locale. -*************************************************************/ - -int tolower_ascii(int c) -{ - smb_ucs2_t uc = tolower_m(UCS2_CHAR(c)); - return UCS2_TO_CHAR(uc); -} - -/************************************************************* - ascii only isupper - saves the need for smbd to be in C locale. -*************************************************************/ - -int isupper_ascii(int c) -{ - return isupper_m(UCS2_CHAR(c)); -} - -/************************************************************* - ascii only islower - saves the need for smbd to be in C locale. -*************************************************************/ - -int islower_ascii(int c) -{ - return islower_m(UCS2_CHAR(c)); -} diff --git a/lib/util/util_str_common.c b/lib/util/util_str_common.c index fe78d65020..20682f9935 100644 --- a/lib/util/util_str_common.c +++ b/lib/util/util_str_common.c @@ -43,7 +43,7 @@ _PUBLIC_ int strwicmp(const char *psz1, const char *psz2) psz1++; while (isspace((int)*psz2)) psz2++; - if (toupper_ascii((unsigned char)*psz1) != toupper_ascii((unsigned char)*psz2) + if (toupper_m((unsigned char)*psz1) != toupper_m((unsigned char)*psz2) || *psz1 == '\0' || *psz2 == '\0') break; |