summary refs log tree commit diff
path: root/locale/programs/localedef.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-25 18:14:28 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-25 18:14:28 +0000
commit07dab0c38525997dc9984f583a71f3b1cbd44cbd (patch)
tree4a37a32c9705fe1170d548d603ad5dbf7ea531a6 /locale/programs/localedef.c
parentab80bec0cbf512c51f040b36a90a732fcaaa397e (diff)
downloadglibc-07dab0c38525997dc9984f583a71f3b1cbd44cbd.tar.gz
glibc-07dab0c38525997dc9984f583a71f3b1cbd44cbd.tar.xz
glibc-07dab0c38525997dc9984f583a71f3b1cbd44cbd.zip
Update.
2000-06-25  Ulrich Drepper  <drepper@redhat.com>

	* locale/programs/ld-collate.c: Correct handling of different
	collation sections.
	* locale/programs/localedef.c (add_to_readlist): Take locale pointer
	as extra parameter from which to copy category information.
	Change all callers.
	(load_locale): Likewise.
	* locale/programs/localedef.h: Update prototypes of add_to_readlist
	and load_locale.
	* locale/programs/ld-ctype.c: Update call to add_to_readlist.
	* locale/programs/locfile.h: Likewise.
	* locale/programs/locfile-kw.gperf: Add entry for script.
	* locale/programs/locfile-token.h: Add tok_script.

	* locale/programs/locale.c: Update copyright year.
	* locale/programs/localedef.c: Likewise.

	* xdr_rec.c (set_input_fragment): Fix PR libc/1549, patch from Jens
Diffstat (limited to 'locale/programs/localedef.c')
-rw-r--r--locale/programs/localedef.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/locale/programs/localedef.c b/locale/programs/localedef.c
index fbd80ccc0f..d0eb711ee4 100644
--- a/locale/programs/localedef.c
+++ b/locale/programs/localedef.c
@@ -296,7 +296,7 @@ print_version (FILE *stream, struct argp_state *state)
 Copyright (C) %s Free Software Foundation, Inc.\n\
 This is free software; see the source for copying conditions.  There is NO\n\
 warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.\n\
-"), "1999");
+"), "2000");
   fprintf (stream, gettext ("Written by %s.\n"), "Ulrich Drepper");
 }
 
@@ -431,7 +431,7 @@ normalize_codeset (codeset, name_len)
 
 struct localedef_t *
 add_to_readlist (int locale, const char *name, const char *repertoire_name,
-		 int generate)
+		 int generate, struct localedef_t *copy_locale)
 {
   struct localedef_t *runp = locales;
 
@@ -463,6 +463,16 @@ add_to_readlist (int locale, const char *name, const char *repertoire_name,
   if (generate && (runp->needed & (1 << locale)) != 0)
     error (5, 0, _("circular dependencies between locale definitions"));
 
+  if (copy_locale != NULL)
+    {
+      if (runp->categories[locale].generic != NULL)
+	error (5, 0, _("cannot add already read locale `%s' a second time"),
+	       name);
+      else
+	runp->categories[locale].generic =
+	  copy_locale->categories[locale].generic;
+    }
+
   runp->needed |= 1 << locale;
 
   return runp;
@@ -476,7 +486,7 @@ find_locale (int locale, const char *name, const char *repertoire_name,
   struct localedef_t *result;
 
   /* Find the locale, but do not generate it since this would be a bug.  */
-  result = add_to_readlist (locale, name, repertoire_name, 0);
+  result = add_to_readlist (locale, name, repertoire_name, 0, NULL);
 
   assert (result != NULL);
 
@@ -491,12 +501,12 @@ find_locale (int locale, const char *name, const char *repertoire_name,
 
 struct localedef_t *
 load_locale (int locale, const char *name, const char *repertoire_name,
-	     struct charmap_t *charmap)
+	     struct charmap_t *charmap, struct localedef_t *copy_locale)
 {
   struct localedef_t *result;
 
   /* Generate the locale if it does not exist.  */
-  result = add_to_readlist (locale, name, repertoire_name, 1);
+  result = add_to_readlist (locale, name, repertoire_name, 1, copy_locale);
 
   assert (result != NULL);