about summary refs log tree commit diff
path: root/locale/programs
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-08-23 07:44:35 +0000
committerUlrich Drepper <drepper@redhat.com>2000-08-23 07:44:35 +0000
commitc9f79e0878de5978b3468b7540302c52a12f3392 (patch)
tree3c11896a249ccf59f15925895ee27e71f7ad0ed2 /locale/programs
parentfb4dfa0c81812d64197d65f8c0c7e57467e09280 (diff)
downloadglibc-c9f79e0878de5978b3468b7540302c52a12f3392.tar.gz
glibc-c9f79e0878de5978b3468b7540302c52a12f3392.tar.xz
glibc-c9f79e0878de5978b3468b7540302c52a12f3392.zip
(ctype_read): Allow more than one default_missing character being specified, pick the first representable.
Diffstat (limited to 'locale/programs')
-rw-r--r--locale/programs/ld-ctype.c54
1 files changed, 38 insertions, 16 deletions
diff --git a/locale/programs/ld-ctype.c b/locale/programs/ld-ctype.c
index f411eac3d3..8904bcad02 100644
--- a/locale/programs/ld-ctype.c
+++ b/locale/programs/ld-ctype.c
@@ -2688,29 +2688,51 @@ with character code range values one must use the absolute ellipsis `...'"));
 		{
 		  uint32_t *wstr;
 
-		  /* We expect a single character or string as the
-		     argument.  */
-		  now = lr_token (ldfile, charmap, NULL);
-		  wstr = read_widestring (ldfile, now, charmap, repertoire);
-
-		  if (wstr != NULL)
+		  while (1)
 		    {
-		      if (ctype->default_missing != NULL)
+		      /* We expect a single character or string as the
+			 argument.  */
+		      now = lr_token (ldfile, charmap, NULL);
+		      wstr = read_widestring (ldfile, now, charmap,
+					      repertoire);
+
+		      if (wstr != NULL)
 			{
-			  lr_error (ldfile, _("\
+			  if (ctype->default_missing != NULL)
+			    {
+			      lr_error (ldfile, _("\
 %s: duplicate `default_missing' definition"), "LC_CTYPE");
-			  error_at_line (0, 0, ctype->default_missing_file,
-					 ctype->default_missing_lineno,
-					 _("previous definition was here"));
+			      error_at_line (0, 0, ctype->default_missing_file,
+					     ctype->default_missing_lineno,
+					     _("\
+previous definition was here"));
+			    }
+			  else
+			    {
+			      ctype->default_missing = wstr;
+			      ctype->default_missing_file = ldfile->fname;
+			      ctype->default_missing_lineno = ldfile->lineno;
+			    }
+			  lr_ignore_rest (ldfile, 1);
+			  break;
 			}
-		      else
+		      else if (wstr == (uint32_t *) -1l)
+			/* This was an syntax error.  */
+			break;
+
+		      /* Maybe there is another replacement we can use.  */
+		      now = lr_token (ldfile, charmap, NULL);
+		      if (now->tok == tok_eol || now->tok == tok_eof)
 			{
-			  ctype->default_missing = wstr;
-			  ctype->default_missing_file = ldfile->fname;
-			  ctype->default_missing_lineno = ldfile->lineno;
+			  /* Nothing found.  We tell the user.  */
+			  lr_error (ldfile, _("\
+%s: no representable `default_missing' definition found"), LC_CTYPE);
+			  break;
 			}
+		      if (now->tok != tok_semicolon)
+			goto translit_syntax;
 		    }
-		  lr_ignore_rest (ldfile, 1);
+
 		  continue;
 		}
 	      else if (now->tok == tok_translit_ignore)