]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 27 Jul 2001 17:34:53 +0000 (17:34 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 27 Jul 2001 17:34:53 +0000 (17:34 +0000)
2001-07-27  Ulrich Drepper  <drepper@redhat.com>

* iconv/gconv_cache.c (__gconv_compare_alias_cache): New function.
* iconv/gconv_int.h: Add prototype for __gconv_compare_alias_cache.
* iconv/gconv_charset.h: Replace __gconv_lookup_alias prototype with
__gconv_compare_alias prototype.
* iconv/gconv_db.c (__gconv_lookup_alias): Removed.
(__gconv_compare_alias): New function.
* locale/findlocale.c (_nl_find_locale): Ise __gconv_compare_alias
instead of calling __gconv_lookup_alias twice and compare here.

ChangeLog
iconv/gconv_charset.h
iconv/gconv_db.c
iconv/gconv_int.h
locale/findlocale.c

index e98129ec8dad84f16cb7b9a9e800979d1d3f8807..0fc053fae0ddb38ed2e00c41a8e7abd57fbf2a7b 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2001-07-27  Ulrich Drepper  <drepper@redhat.com>
+
+       * iconv/gconv_cache.c (__gconv_compare_alias_cache): New function.
+       * iconv/gconv_int.h: Add prototype for __gconv_compare_alias_cache.
+       * iconv/gconv_charset.h: Replace __gconv_lookup_alias prototype with
+       __gconv_compare_alias prototype.
+       * iconv/gconv_db.c (__gconv_lookup_alias): Removed.
+       (__gconv_compare_alias): New function.
+       * locale/findlocale.c (_nl_find_locale): Ise __gconv_compare_alias
+       instead of calling __gconv_lookup_alias twice and compare here.
+
 2001-07-26  Mark Kettenis  <kettenis@gnu.org>
 
        * hurd/hurdsig.c (_hurd_internal_post_signal): Fix handling of
index 1e2b76bdca581cf5c4ac0cfd21c4ba4b6c36e28b..b0b28079c64f914884b6728d472bd3dc48ea708b 100644 (file)
@@ -57,4 +57,5 @@ upstr (char *dst, const char *str)
 
 
 /* If NAME is an codeset alias expand it.  */
-extern const char *__gconv_lookup_alias (const char *name);
+extern int __gconv_compare_alias (const char *name1, const char *name2)
+     internal_function;
index 47861d19caaa62658de539fb8871be8458b107a6..9bd27c5e697a3968f9471e4dc4f9a07f8abcb944 100644 (file)
@@ -632,13 +632,20 @@ do_lookup_alias (const char *name)
 }
 
 
-const char *
-__gconv_lookup_alias (const char *name)
+int
+internal_function
+__gconv_compare_alias (const char *name1, const char *name2)
 {
+  int result;
+
   /* Ensure that the configuration data is read.  */
   __libc_once (once, __gconv_read_conf);
 
-  return do_lookup_alias (name) ?: name;
+  if (__gconv_compare_alias_cache (name1, name2, &result) != 0)
+    result = strcmp (do_lookup_alias (name1) ?: name1,
+                    do_lookup_alias (name2) ?: name2);
+
+  return result;
 }
 
 
index 13698d8ac4d717874c9461f3be2b3851df11409c..3b5f195b0478138c2a3fef323758af15ad40cf85 100644 (file)
@@ -188,6 +188,12 @@ extern int __gconv_lookup_cache (const char *toset, const char *fromset,
                                 int flags)
      internal_function;
 
+/* Compare the two name for whether they are after alias expansion the
+   same.  This function uses the cache and fails if none is
+   loaded.  */
+extern int __gconv_compare_alias_cache (const char *name1, const char *name2,
+                                       int *result) internal_function;
+
 /* Free data associated with a step's structure.  */
 extern void __gconv_release_step (struct __gconv_step *step)
      internal_function;
index 27702586a3bd12cf2ed32f40709207e4f3a648b0..59b99925bf41bd6ca285983e87b078c30510d79f 100644 (file)
@@ -207,9 +207,9 @@ _nl_find_locale (const char *locale_path, size_t locale_path_len,
       ccodeset = (char *) alloca (strlen (codeset) + 3);
       strip (ccodeset, codeset);
 
-      if (strcmp (__gconv_lookup_alias (upstr (ccodeset, ccodeset)),
-                 __gconv_lookup_alias (upstr (clocale_codeset,
-                                              clocale_codeset))) != 0)
+      if (__gconv_compare_alias (upstr (ccodeset, ccodeset),
+                                upstr (clocale_codeset,
+                                       clocale_codeset)) != 0)
        /* The codesets are not identical, don't use the locale.  */
        return NULL;
     }