This is the mail archive of the
libc-alpha@sources.redhat.com
mailing list for the glibc project.
gconv_trans tweak
- To: libc-alpha at sources dot redhat dot com
- Subject: gconv_trans tweak
- From: Bruno Haible <haible at ilog dot fr>
- Date: Mon, 4 Sep 2000 14:56:37 +0200 (CEST)
The open_count member of `struct known_trans' is not yet used, but when it
will, it should be incremented in __gconv_translit_find.
Also, when storing in the hash table an entry for a module that wasn't
found, it seems better to clear the filename, not only the handle.
2000-09-03 Bruno Haible <haible@clisp.cons.org>
* iconv/gconv_trans.c (__gconv_translit_find): Update open_count.
Set fname to NULL if the module wasn't found.
*** glibc-20000831/iconv/gconv_trans.c.bak Mon Aug 28 13:34:25 2000
--- glibc-20000831/iconv/gconv_trans.c Sat Sep 2 16:52:59 2000
***************
*** 330,335 ****
--- 330,336 ----
{
/* Copy the data. */
*trans = (*found)->info;
+ (*found)->open_count++;
res = 0;
}
}
***************
*** 366,372 ****
newp->fname = cp;
! /* Seach in all the directories. */
for (runp = __gconv_path_elem; runp->name != NULL; ++runp)
{
cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name),
--- 367,373 ----
newp->fname = cp;
! /* Search in all the directories. */
for (runp = __gconv_path_elem; runp->name != NULL; ++runp)
{
cp = __mempcpy (__stpcpy ((char *) newp->fname, runp->name),
***************
*** 381,386 ****
--- 382,390 ----
break;
}
}
+
+ if (res)
+ newp->fname = NULL;
/* In any case we'll add the entry to our search tree. */
if (__tsearch (newp, &search_tree, trans_compare) == NULL)