about summary refs log tree commit diff
path: root/locale/programs
diff options
context:
space:
mode:
Diffstat (limited to 'locale/programs')
-rw-r--r--locale/programs/charmap.c4
-rw-r--r--locale/programs/charset.c5
-rw-r--r--locale/programs/ld-collate.c12
3 files changed, 10 insertions, 11 deletions
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c
index 27c83cc0a7..1573d6c002 100644
--- a/locale/programs/charmap.c
+++ b/locale/programs/charmap.c
@@ -1,4 +1,4 @@
-/* Copyright (C) 1996, 1997 Free Software Foundation, Inc.
+/* Copyright (C) 1996, 1997, 1998 Free Software Foundation, Inc.
    This file is part of the GNU C Library.
    Contributed by Ulrich Drepper <drepper@gnu.ai.mit.edu>, 1996.
 
@@ -471,7 +471,7 @@ argument to <%s> must be a single character"),
 					    cmfile->token.val.str.start,
 					    cmfile->token.val.str.len);
 
-	  state = 3;
+	  state = 5;
 	  continue;
 
 	case 90:
diff --git a/locale/programs/charset.c b/locale/programs/charset.c
index 00233abf8f..fdacf25328 100644
--- a/locale/programs/charset.c
+++ b/locale/programs/charset.c
@@ -125,10 +125,11 @@ insert_char (struct linereader *lr, struct charset_t *cs, int bytes,
 
   for (cnt = from_nr; cnt <= to_nr; ++cnt)
     {
-      sprintf (&buf[prefix_len], "%0d", cnt);
+      sprintf (&buf[prefix_len], "%0*d", len1 - prefix_len, cnt);
 
       if (insert_entry (&cs->char_table, buf, len1,
-			(void *) (unsigned long int) cnt) < 0)
+			(void *) (unsigned long int) (value + (cnt - from_nr)))
+	  < 0)
 	lr_error (lr, _("duplicate character name `%s'"), buf);
     }
 }
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index 3a8c17a303..f01b1f662b 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -190,7 +190,7 @@ collate_startup (struct linereader *lr, struct localedef_t *locale,
   collate->all_patches = NULL;
 
   /* This tells us no UNDEFINED entry was found until now.  */
-  collate->undefined.this_weight = 0;
+  memset (&collate->undefined, '\0', sizeof (collate->undefined));
 
   lr->translate_strings = 0;
 }
@@ -457,12 +457,10 @@ Computing table size for collation information might take a while..."),
 	       information.  While reading them they get inserted in the      \
 	       table and later not removed when something goes wrong with     \
 	       reading its weights.  */					      \
-	    {								      \
-	      value += 1 + runp->ordering[cnt];				      \
+	    value += 1 + runp->ordering[cnt];				      \
 									      \
-	      if (runp->name[1] == L'\0')				      \
-		has_simple = runp;					      \
-	    }								      \
+	  if (runp->name[1] == L'\0')					      \
+	    has_simple = runp;						      \
 									      \
 	  ADD_ELEMENT (runp, value);					      \
 	}								      \
@@ -1891,7 +1889,7 @@ collate_end_weight (struct linereader *lr, struct localedef_t *locale)
 	  || collate->kind == undefined);
 
   /* Fill in the missing weights.  */
-  while (++collate->weight_idx < collate->nrules)
+  while (collate->weight_idx++ < collate->nrules)
     {
       collate->weight[collate->nweight++] = pelem->this_weight;
       ++collate->weight_cnt[collate->weight_idx];