about summary refs log tree commit diff
path: root/locale
diff options
context:
space:
mode:
Diffstat (limited to 'locale')
-rw-r--r--locale/programs/ld-collate.c19
1 files changed, 17 insertions, 2 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index b9ea186d31..191194799d 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -1809,7 +1809,15 @@ symbol `%s' has the same encoding as"), (*eptr)->name);
   sect = collate->sections;
   while (sect != NULL && sect->rules == NULL)
     sect = sect->next;
-  assert (sect != NULL);
+
+  /* Bail out if we have no sections because of earlier errors.  */
+  if (sect == NULL)
+    {
+      WITH_CUR_LOCALE (error (EXIT_FAILURE, 0,
+			      _("too many errors; giving up")));
+      return;
+    }
+
   ruleidx = 0;
   do
     {
@@ -3489,11 +3497,18 @@ error while adding equivalent collating symbol"));
 	      symstr = ucs4buf;
 	      symlen = 9;
 	    }
-	  else
+	  else if (arg != NULL)
 	    {
 	      symstr = arg->val.str.startmb;
 	      symlen = arg->val.str.lenmb;
 	    }
+	  else
+	    {
+	      lr_error (ldfile, _("%s: bad symbol <%.*s>"), "LC_COLLATE",
+			ldfile->token.val.str.lenmb,
+			ldfile->token.val.str.startmb);
+	      break;
+	    }
 
 	  if (state == 0)
 	    {