summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Allison <jra@samba.org>1997-12-11 12:25:01 +0000
committerJeremy Allison <jra@samba.org>1997-12-11 12:25:01 +0000
commit4ac95226fff8e48a0024e2beb78df662fcfeda62 (patch)
tree11cbfca586f67a0a0d583e1a187e9810fc05b3dc
parentdb9898559f1493ade4478196b72663759bb18995 (diff)
downloadsamba-4ac95226fff8e48a0024e2beb78df662fcfeda62.tar.gz
samba-4ac95226fff8e48a0024e2beb78df662fcfeda62.tar.xz
samba-4ac95226fff8e48a0024e2beb78df662fcfeda62.zip
fixed over char 127 problems with isupper/islower.
Jeremy.
-rw-r--r--source/lib/charset.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source/lib/charset.c b/source/lib/charset.c
index 217f407b9eb..e29e60303aa 100644
--- a/source/lib/charset.c
+++ b/source/lib/charset.c
@@ -167,8 +167,13 @@ void charset_initialise()
for (i=0; i<=255; i++) {
char c = (char)i;
upper_char_map[i] = lower_char_map[i] = c;
- if (isupper(c)) lower_char_map[i] = tolower(c);
- if (islower(c)) upper_char_map[i] = toupper(c);
+
+ /* Some systems have buggy isupper/islower for characters
+ above 127. Best not to rely on them. */
+ if(i < 128) {
+ if (isupper(c)) lower_char_map[i] = tolower(c);
+ if (islower(c)) upper_char_map[i] = toupper(c);
+ }
}
}