svn commit: samba r2639 - in branches/SAMBA_4_0/source/lib: .
tridge at samba.org
tridge at samba.org
Sun Sep 26 01:09:05 GMT 2004
Author: tridge
Date: 2004-09-26 01:09:04 +0000 (Sun, 26 Sep 2004)
New Revision: 2639
WebSVN: http://websvn.samba.org/websvn/changeset.php?rep=samba&path=/branches/SAMBA_4_0/source/lib&rev=2639&nolog=1
Log:
we doon't need the valid_table code, so get rid of it
Modified:
branches/SAMBA_4_0/source/lib/util_unistr.c
Changeset:
Modified: branches/SAMBA_4_0/source/lib/util_unistr.c
===================================================================
--- branches/SAMBA_4_0/source/lib/util_unistr.c 2004-09-26 01:08:29 UTC (rev 2638)
+++ branches/SAMBA_4_0/source/lib/util_unistr.c 2004-09-26 01:09:04 UTC (rev 2639)
@@ -25,7 +25,6 @@
at startup either via mmap() or read() from the lib directory */
static smb_ucs2_t *upcase_table;
static smb_ucs2_t *lowcase_table;
-static uint8_t *valid_table;
/*******************************************************************
@@ -103,61 +102,6 @@
return (c == c2);
}
-/**
- * Load the valid character map table from <tt>valid.dat</tt> or
- * create from the configured codepage.
- *
- * This function is called whenever the configuration is reloaded.
- * However, the valid character table is not changed if it's loaded
- * from a file, because we can't unmap files.
- **/
-void init_valid_table(void)
-{
- static int mapped_file;
- int i;
- const char *allowed = ".!#$%&'()_-@^`~";
- uint8_t *valid_file;
- TALLOC_CTX *mem_ctx;
-
- if (mapped_file) {
- /* Can't unmap files, so stick with what we have */
- return;
- }
-
- mem_ctx = talloc_init("init_valid_table");
- if (!mem_ctx) {
- smb_panic("No memory for valid_table");
- }
- valid_file = map_file(lib_path(mem_ctx, "valid.dat"), 0x10000);
- talloc_destroy(mem_ctx);
- if (valid_file) {
- valid_table = valid_file;
- mapped_file = 1;
- return;
- }
-
- /* Otherwise, we're using a dynamically created valid_table.
- * It might need to be regenerated if the code page changed.
- * We know that we're not using a mapped file, so we can
- * free() the old one. */
- if (valid_table) free(valid_table);
-
- DEBUG(2,("creating default valid table\n"));
- valid_table = malloc(0x10000);
- if (!valid_table) {
- smb_panic("No memory for valid_table");
- }
- for (i=0;i<128;i++)
- valid_table[i] = isalnum(i) || strchr(allowed,i);
-
- for (;i<0x10000;i++) {
- smb_ucs2_t c;
- SSVAL(&c, 0, i);
- valid_table[i] = check_dos_char(c);
- }
-}
-
-
/*******************************************************************
Convert a wchar to upper case.
********************************************************************/
More information about the samba-cvs
mailing list