summaryrefslogtreecommitdiff
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
commit155562e514ca0abc537f53b612a7df13461829ac (patch)
tree61b28d392ecfc17e26665e75da24fb9517382182
parent7735e4d5868d2ddb659c8e76123174b553d05f55 (diff)
downloadsamba-155562e514ca0abc537f53b612a7df13461829ac.tar.gz
samba-155562e514ca0abc537f53b612a7df13461829ac.tar.bz2
samba-155562e514ca0abc537f53b612a7df13461829ac.zip
fixed over char 127 problems with isupper/islower.
Jeremy. (This used to be commit 4ac95226fff8e48a0024e2beb78df662fcfeda62)
-rw-r--r--source3/lib/charset.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/source3/lib/charset.c b/source3/lib/charset.c
index 217f407b9e..e29e60303a 100644
--- a/source3/lib/charset.c
+++ b/source3/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);
+ }
}
}