summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndrew Tridgell <tridge@samba.org>2001-11-29 05:03:15 +0000
committerAndrew Tridgell <tridge@samba.org>2001-11-29 05:03:15 +0000
commitfbcf770865d8c5273423bb45ab0ebc73dc449dbc (patch)
tree6c46d88cfa974a8f2637d07f35829d0ebbfd7728
parent8bd89c72a37407dbc4bcbe15b0bd25cd7a12ccf3 (diff)
downloadsamba-fbcf770865d8c5273423bb45ab0ebc73dc449dbc.tar.gz
samba-fbcf770865d8c5273423bb45ab0ebc73dc449dbc.tar.bz2
samba-fbcf770865d8c5273423bb45ab0ebc73dc449dbc.zip
2nd attempt at fixing lame char tables on big endian machines
(This used to be commit 80841f5763b3ab03a82ab0a18a9126d89ffed2d5)
-rw-r--r--source3/lib/util_unistr.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/source3/lib/util_unistr.c b/source3/lib/util_unistr.c
index 5d4697e441..44e792a9fd 100644
--- a/source3/lib/util_unistr.c
+++ b/source3/lib/util_unistr.c
@@ -52,23 +52,23 @@ void load_case_tables(void)
if (!upcase_table) {
DEBUG(1,("creating lame upcase table\n"));
upcase_table = malloc(0x20000);
- for (i=0;i<256;i++) upcase_table[i] = UCS2_CHAR(islower(i)?toupper(i):i);
- for (;i<0x10000;i++) upcase_table[i] = UCS2_CHAR(i);
+ for (i=0;i<0x10000;i++) upcase_table[i] = i;
+ for (i=0;i<256;i++) upcase_table[UCS2_CHAR(i)] = UCS2_CHAR(islower(i)?toupper(i):i);
}
if (!lowcase_table) {
DEBUG(1,("creating lame lowcase table\n"));
lowcase_table = malloc(0x20000);
- for (i=0;i<256;i++) lowcase_table[i] = UCS2_CHAR(isupper(i)?tolower(i):i);
- for (;i<0x10000;i++) lowcase_table[i] = UCS2_CHAR(i);
+ for (i=0;i<0x10000;i++) upcase_table[i] = i;
+ for (i=0;i<256;i++) lowcase_table[UCS2_CHAR(i)] = UCS2_CHAR(isupper(i)?tolower(i):i);
}
if (!valid_table) {
const char *allowed = "!#$%&'()_-@^`~";
DEBUG(1,("creating lame valid table\n"));
valid_table = malloc(0x10000);
- for (i=0;i<256;i++) valid_table[i] = UCS2_CHAR(isalnum(i) || strchr(allowed,i));
- for (;i<0x10000;i++) valid_table[i] = 0;
+ for (0;i<0x10000;i++) valid_table[i] = 0;
+ for (i=0;i<256;i++) valid_table[UCS2_CHAR(i)] = isalnum(i) || strchr(allowed,i);
}
}