diff options
Diffstat (limited to 'lib/util/charset/codepoints.c')
-rw-r--r-- | lib/util/charset/codepoints.c | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/lib/util/charset/codepoints.c b/lib/util/charset/codepoints.c index 0984164d48..499cea42f0 100644 --- a/lib/util/charset/codepoints.c +++ b/lib/util/charset/codepoints.c @@ -47,15 +47,16 @@ This is the function that should be called from library code. ********************************************************************/ void load_case_tables_library(void) { - TALLOC_CTX *mem_ctx; + const char *codepagedir = get_dyn_CODEPAGEDIR(); + size_t codepagedir_len = strlen(codepagedir); + char buf[codepagedir_len+13]; + + snprintf(buf, sizeof(buf), "%s/upcase.dat", codepagedir); + upcase_table = map_file(buf, 0x20000); + + snprintf(buf, sizeof(buf), "%s/lowcase.dat", codepagedir); + lowcase_table = map_file(buf, 0x20000); - mem_ctx = talloc_init("load_case_tables"); - if (!mem_ctx) { - smb_panic("No memory for case_tables"); - } - upcase_table = map_file(talloc_asprintf(mem_ctx, "%s/upcase.dat", get_dyn_CODEPAGEDIR()), 0x20000); - lowcase_table = map_file(talloc_asprintf(mem_ctx, "%s/lowcase.dat", get_dyn_CODEPAGEDIR()), 0x20000); - talloc_free(mem_ctx); if (upcase_table == NULL) { DEBUG(1, ("Failed to load upcase.dat, will use lame ASCII-only case sensitivity rules\n")); upcase_table = (void *)-1; |