about summary refs log tree commit diff
path: root/locale/programs
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-01-27 00:19:43 +0000
committerUlrich Drepper <drepper@redhat.com>2000-01-27 00:19:43 +0000
commit4b1c1a6ffaf2feba6232dff7a5ceef4ad2d9c482 (patch)
tree43f5383586fdba9dffbc534dd527fb482c33bcdd /locale/programs
parent4e2e99997a2890df8ab5d7b86646a2b067eb8723 (diff)
downloadglibc-4b1c1a6ffaf2feba6232dff7a5ceef4ad2d9c482.tar.gz
glibc-4b1c1a6ffaf2feba6232dff7a5ceef4ad2d9c482.tar.xz
glibc-4b1c1a6ffaf2feba6232dff7a5ceef4ad2d9c482.zip
Update.
2000-01-26  Ulrich Drepper  <drepper@cygnus.com>

	* locale/programs/ld-collate.c (check_duplicate): Fix printing of error
	messages.
	(collate_read): Remove unnecessary `if'.
Diffstat (limited to 'locale/programs')
-rw-r--r--locale/programs/ld-collate.c90
1 files changed, 44 insertions, 46 deletions
diff --git a/locale/programs/ld-collate.c b/locale/programs/ld-collate.c
index eb0c55ee63..642eddd210 100644
--- a/locale/programs/ld-collate.c
+++ b/locale/programs/ld-collate.c
@@ -342,26 +342,29 @@ check_duplicate (struct linereader *ldfile, struct locale_collate_t *collate,
 
   if (find_entry (&charmap->char_table, symbol, symbol_len, &ignore) == 0)
     {
-      lr_error (ldfile, _("`%s' already defined in charmap"), symbol);
+      lr_error (ldfile, _("`%.*s' already defined in charmap"),
+		(int) symbol_len, symbol);
       return 1;
     }
 
   if (find_entry (&repertoire->char_table, symbol, symbol_len, &ignore) == 0)
     {
-      lr_error (ldfile, _("`%s' already defined in repertoire"), symbol);
+      lr_error (ldfile, _("`%.*s' already defined in repertoire"),
+		(int) symbol_len, symbol);
       return 1;
     }
 
   if (find_entry (&collate->sym_table, symbol, symbol_len, &ignore) == 0)
     {
-      lr_error (ldfile, _("`%s' already defined as collating symbol"), symbol);
+      lr_error (ldfile, _("`%.*s' already defined as collating symbol"),
+		(int) symbol_len, symbol);
       return 1;
     }
 
   if (find_entry (&collate->elem_table, symbol, symbol_len, &ignore) == 0)
     {
-      lr_error (ldfile, _("`%s' already defined as collating element"),
-		symbol);
+      lr_error (ldfile, _("`%.*s' already defined as collating element"),
+		(int) symbol_len, symbol);
       return 1;
     }
 
@@ -2881,57 +2884,52 @@ error while adding collating symbol"));
 	      symname = arg->val.str.startmb;
 	      symname_len = arg->val.str.lenmb;
 
-	      if (!ignore_content)
+	      if (newname == NULL)
 		{
-		  if (newname == NULL)
-		    {
-		      lr_error (ldfile, _("\
+		  lr_error (ldfile, _("\
 %s: unknown character in equivalent definition name"),
-				"LC_COLLATE");
-		      goto sym_equiv_free;
-		    }
-		  if (symname == NULL)
-		    {
-		      lr_error (ldfile, _("\
-%s: unknown character in equivalent definition value"),
-				"LC_COLLATE");
-		      goto sym_equiv_free;
-		    }
-		  /* The name is already defined.  */
-		  if (check_duplicate (ldfile, collate, charmap,
-				       repertoire, symname, symname_len))
-		    goto col_sym_free;
-
-		  /* See whether the symbol name is already defined.  */
-		  if (find_entry (&collate->sym_table, symname, symname_len,
-				  (void **) &symval) != 0)
-		    {
-		      lr_error (ldfile, _("\
-%s: unknown symbol `%s' in equivalent definition"),
-				"LC_COLLATE", symname);
-		      goto col_sym_free;
-		    }
-
-		  if (insert_entry (&collate->sym_table,
-				    newname, newname_len, symval) < 0)
-		    {
-		      lr_error (ldfile, _("\
-error while adding equivalent collating symbol"));
-		      goto sym_equiv_free;
-		    }
+			    "LC_COLLATE");
 
-		  free ((char *) symname);
-		}
-	      else
-		{
 		sym_equiv_free:
 		  if (newname != NULL)
 		    free ((char *) newname);
 		  if (symname != NULL)
 		    free ((char *) symname);
+		  break;
 		}
-	      lr_ignore_rest (ldfile, 1);
+	      if (symname == NULL)
+		{
+		  lr_error (ldfile, _("\
+%s: unknown character in equivalent definition value"),
+			    "LC_COLLATE");
+		  goto sym_equiv_free;
+		}
+	      /* The name is already defined.  */
+	      if (check_duplicate (ldfile, collate, charmap,
+				   repertoire, symname, symname_len))
+		goto col_sym_free;
+
+	      /* See whether the symbol name is already defined.  */
+	      if (find_entry (&collate->sym_table, symname, symname_len,
+			      (void **) &symval) != 0)
+		{
+		  lr_error (ldfile, _("\
+%s: unknown symbol `%s' in equivalent definition"),
+			    "LC_COLLATE", symname);
+		  goto col_sym_free;
+		}
+
+	      if (insert_entry (&collate->sym_table,
+				newname, newname_len, symval) < 0)
+		{
+		  lr_error (ldfile, _("\
+error while adding equivalent collating symbol"));
+		  goto sym_equiv_free;
+		}
+
+	      free ((char *) symname);
 	    }
+	  lr_ignore_rest (ldfile, 1);
 	  break;
 
 	case tok_order_start: