about summary refs log tree commit diff
path: root/locale/programs/charmap.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-06-20 22:30:32 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-20 22:30:32 +0000
commit620cdffb589dd11bb5e17cf0af0b1d559d4037ce (patch)
treeee1e63ca80c67b8e22b04fc35c581bcff278b06a /locale/programs/charmap.c
parent8d6120a9cc3d3dcee3662f39a5dede14ae259dae (diff)
downloadglibc-620cdffb589dd11bb5e17cf0af0b1d559d4037ce.tar.gz
glibc-620cdffb589dd11bb5e17cf0af0b1d559d4037ce.tar.xz
glibc-620cdffb589dd11bb5e17cf0af0b1d559d4037ce.zip
Update.
2000-06-20  Ulrich Drepper  <drepper@redhat.com>

	* locale/programs/charmap.c (parse_charmap): Handle UCS names also
	in width definitions.
Diffstat (limited to 'locale/programs/charmap.c')
-rw-r--r--locale/programs/charmap.c45
1 files changed, 32 insertions, 13 deletions
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c
index 8ffb8a06ea..073d458849 100644
--- a/locale/programs/charmap.c
+++ b/locale/programs/charmap.c
@@ -720,7 +720,7 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
 	      continue;
 	    }
 
-	  if (nowtok != tok_bsymbol)
+	  if (nowtok != tok_bsymbol && nowtok != tok_ucs4)
 	    {
 	      lr_error (cmfile, _("syntax error in %s definition: %s"),
 			"WIDTH_VARIABLE", _("no symbolic name given"));
@@ -733,9 +733,17 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
 	  if (from_name != NULL)
 	    obstack_free (&result->mem_pool, from_name);
 
-	  from_name = (char *) obstack_copy0 (&result->mem_pool,
-					      now->val.str.startmb,
-					      now->val.str.lenmb);
+	  if (nowtok == tok_bsymbol)
+	    from_name = (char *) obstack_copy0 (&result->mem_pool,
+						now->val.str.startmb,
+						now->val.str.lenmb);
+	  else
+	    {
+	      obstack_printf (&result->mem_pool, "U%08X",
+			      cmfile->token.val.ucs4);
+	      obstack_1grow (&result->mem_pool, '\0');
+	      from_name = (char *) obstack_finish (&result->mem_pool);
+	    }
 	  to_name = NULL;
 
 	  state = 99;
@@ -753,19 +761,30 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
 	  continue;
 
 	case 100:
-	  if (nowtok != tok_bsymbol)
-	    lr_error (cmfile, _("syntax error in %s definition: %s"),
-		      "WIDTH_VARIABLE",
-		      _("no symbolic name given for end of range"));
+	  if (nowtok != tok_bsymbol && nowtok != tok_ucs4)
+	    {
+	      lr_error (cmfile, _("syntax error in %s definition: %s"),
+			"WIDTH_VARIABLE",
+			_("no symbolic name given for end of range"));
+	      lr_ignore_rest (cmfile, 0);
+	      continue;
+	    }
+
+	  if (nowtok == tok_bsymbol)
+	    to_name = (char *) obstack_copy0 (&result->mem_pool,
+					      now->val.str.startmb,
+					      now->val.str.lenmb);
 	  else
 	    {
-	      to_name = (char *) obstack_copy0 (&result->mem_pool,
-						now->val.str.startmb,
-						now->val.str.lenmb);
-	      /* XXX Enter value into table.  */
+	      obstack_printf (&result->mem_pool, "U%08X",
+			      cmfile->token.val.ucs4);
+	      obstack_1grow (&result->mem_pool, '\0');
+	      to_name = (char *) obstack_finish (&result->mem_pool);
 	    }
 
-	  lr_ignore_rest (cmfile, nowtok == tok_bsymbol);
+	  /* XXX Enter value into table.  */
+
+	  lr_ignore_rest (cmfile, 1);
 
 	  state = 98;
 	  continue;