]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Mon, 27 Sep 1999 16:47:01 +0000 (16:47 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 27 Sep 1999 16:47:01 +0000 (16:47 +0000)
* locale/programs/ld-collate.c (insert_value): Add hack to not
crash in incomplete collate implementation.

ChangeLog
locale/programs/ld-collate.c

index 200bf9329b4f44cba9274c451029c15b3dd03d0e..b6a42b806f111ffdd6c89071a0797f9775d790a4 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 1999-09-27  Ulrich Drepper  <drepper@cygnus.com>
 
+       * locale/programs/ld-collate.c (insert_value): Add hack to not
+       crash in incomplete collate implementation.
+
        * locale/programs/ld-collate.c (read_directions): Read new token
        after accepting sorting rule.
 
index 070c65a2d8131205fdc4967a313152e8a25e7cd6..fcfdc817a0ebf60647ccbdbbc448fedeb24dcb5f 100644 (file)
@@ -423,7 +423,7 @@ insert_value (struct linereader *ldfile, struct token *arg,
   /* Try to find the character in the charmap.  */
   seq = charmap_find_value (charmap, arg->val.str.startmb, arg->val.str.lenmb);
 
-  if (wc == ILLEGAL_CHAR_VALUE)
+  if (wc == ILLEGAL_CHAR_VALUE && seq == NULL)
     {
       /* It's no character, so look through the collation elements and
         symbol list.  */
@@ -435,17 +435,29 @@ insert_value (struct linereader *ldfile, struct token *arg,
          /* It's a collation symbol.  */
          struct symbol_t *sym = (struct symbol_t *) result;
          elem = sym->order;
+
+         if (elem == NULL)
+           elem = sym->order = new_element (collate, arg->val.str.startmb,
+                                            arg->val.str.startwc);
        }
       else if (find_entry (&collate->elem_table, arg->val.str.startmb,
-                          arg->val.str.lenmb, &result) != 0)
+                          arg->val.str.lenmb, &elem) != 0)
        /* It's also no collation element.  Therefore ignore it.  */
        return;
     }
+  else
+    {
+      /* Otherwise the symbols stands for an character.  Make sure it is
+        not already in the table.  */
+
+    }
 
-  /* XXX elem must be defined.  */
+  if (elem == NULL)
+    /* XXX HACK HACK HACK */
+    return;
 
   /* Test whether this element is not already in the list.  */
-  if (elem->next != NULL)
+  if (elem->next != NULL || elem->next == collate->cursor)
     {
       lr_error (ldfile, _("order for `%.*s' already defined at %s:%Z"),
                arg->val.str.startmb, arg->val.str.lenmb,