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:24:45 +0000
committerUlrich Drepper <drepper@redhat.com>2000-06-20 22:24:45 +0000
commit8d6120a9cc3d3dcee3662f39a5dede14ae259dae (patch)
treeb0c02abb76b3212fb6947695dc86d76d06bd7aac /locale/programs/charmap.c
parent9380bb48e9b48c6e80d82cb89835a039d8bb0371 (diff)
downloadglibc-8d6120a9cc3d3dcee3662f39a5dede14ae259dae.tar.gz
glibc-8d6120a9cc3d3dcee3662f39a5dede14ae259dae.tar.xz
glibc-8d6120a9cc3d3dcee3662f39a5dede14ae259dae.zip
(parse_charmap): Handle UCS names also in width definitions.
Diffstat (limited to 'locale/programs/charmap.c')
-rw-r--r--locale/programs/charmap.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/locale/programs/charmap.c b/locale/programs/charmap.c
index dec09a6118..8ffb8a06ea 100644
--- a/locale/programs/charmap.c
+++ b/locale/programs/charmap.c
@@ -624,7 +624,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", _("no symbolic name given"));
@@ -636,9 +636,18 @@ 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 = 94;
@@ -670,7 +679,7 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
 	  continue;
 
 	case 95:
-	  if (nowtok != tok_bsymbol)
+	  if (nowtok != tok_bsymbol && nowtok != tok_ucs4)
 	    {
 	      lr_error (cmfile, _("syntax error in %s definition: %s"),
 			"WIDTH", _("no symbolic name given for end of range"));
@@ -681,9 +690,17 @@ only WIDTH definitions are allowed to follow the CHARMAP definition"));
 	      continue;
 	    }
 
-	  to_name = (char *) obstack_copy0 (&result->mem_pool,
-					    now->val.str.startmb,
-					    now->val.str.lenmb);
+	  if (nowtok == tok_bsymbol)
+	    to_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');
+	      to_name = (char *) obstack_finish (&result->mem_pool);
+	    }
 
 	  state = 96;
 	  continue;