about summary refs log tree commit diff
path: root/locale/programs/locale.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>2000-10-31 06:06:35 +0000
committerUlrich Drepper <drepper@redhat.com>2000-10-31 06:06:35 +0000
commitbeaaf574bfe6cb503269970fc53ebeacf63eae57 (patch)
tree4cc9d21aeba24007193b2623caaee7eb4a7e87ce /locale/programs/locale.c
parentde153e7f50baa4ea7fac013f3b77b3a4fe314664 (diff)
downloadglibc-beaaf574bfe6cb503269970fc53ebeacf63eae57.tar.gz
glibc-beaaf574bfe6cb503269970fc53ebeacf63eae57.tar.xz
glibc-beaaf574bfe6cb503269970fc53ebeacf63eae57.zip
Update.
	* locale/localeinfo.h (enum value_type): Add wstring, wstringarray,
	and wstringlist.
	* locale/categories.def: Mark wide char strings as wstring or
	stringarray.
	* locale/programs/locale.c (show_info): Handle wstring, wstringarray,
	and wstringlist.  Print keywords only if there is real output.
	Reported by Chen Xiangyang <chenxy@opencjk.org>.

	* sysdeps/sparc/fpu/bits/mathinline.h: Add __THROW where necessary.
	Patch by Ben Collins <bcollins@debian.org>.
Diffstat (limited to 'locale/programs/locale.c')
-rw-r--r--locale/programs/locale.c33
1 files changed, 25 insertions, 8 deletions
diff --git a/locale/programs/locale.c b/locale/programs/locale.c
index 7a42f1e3a4..0b61467c1f 100644
--- a/locale/programs/locale.c
+++ b/locale/programs/locale.c
@@ -551,17 +551,15 @@ show_info (const char *name)
 
   void print_item (struct cat_item *item)
     {
-      if (show_keyword_name != 0)
-	printf ("%s=", item->name);
-
       switch (item->value_type)
 	{
 	case string:
 	  if (show_keyword_name)
-	    putchar ('"');
+	    printf ("%s=\"", item->name);
 	  print_escaped (nl_langinfo (item->item_id) ? : "");
 	  if (show_keyword_name)
 	    putchar ('"');
+	  putchar ('\n');
 	  break;
 	case stringarray:
 	  {
@@ -569,7 +567,7 @@ show_info (const char *name)
 	    const char *val;
 
 	    if (show_keyword_name)
-	      putchar ('"');
+	      printf ("%s=\"", item->name);
 
 	    for (cnt = 0; cnt < item->max - 1; ++cnt)
 	      {
@@ -585,6 +583,7 @@ show_info (const char *name)
 
 	    if (show_keyword_name)
 	      putchar ('"');
+	    putchar ('\n');
 	  }
 	  break;
 	case stringlist:
@@ -592,6 +591,9 @@ show_info (const char *name)
 	    int first = 1;
 	    const char *val = nl_langinfo (item->item_id) ? : "";
 
+	    if (show_keyword_name)
+	      printf ("%s=", item->name);
+
 	    while (*val != '\0')
 	      {
 		printf ("%s%s%s%s", first ? "" : ";",
@@ -600,14 +602,19 @@ show_info (const char *name)
 		val = strchr (val, '\0') + 1;
 		first = 0;
 	      }
+	    putchar ('\n');
 	  }
 	  break;
 	case byte:
 	  {
 	    const char *val = nl_langinfo (item->item_id);
 
+	    if (show_keyword_name)
+	      printf ("%s=", item->name);
+
 	    if (val != NULL)
 	      printf ("%d", *val == CHAR_MAX ? -1 : *val);
+	    putchar ('\n');
 	  }
 	  break;
 	case bytearray:
@@ -615,6 +622,9 @@ show_info (const char *name)
 	    const char *val = nl_langinfo (item->item_id);
 	    int cnt = val ? strlen (val) : 0;
 
+	    if (show_keyword_name)
+	      printf ("%s=", item->name);
+
 	    while (cnt > 1)
 	      {
 		printf ("%d;", *val == CHAR_MAX ? -1 : *val);
@@ -622,19 +632,26 @@ show_info (const char *name)
 		++val;
 	      }
 
-	    printf ("%d", cnt == 0 || *val == CHAR_MAX ? -1 : *val);
+	    printf ("%d\n", cnt == 0 || *val == CHAR_MAX ? -1 : *val);
 	  }
 	  break;
 	case word:
 	  {
 	    unsigned int val =
 	      (unsigned int) (unsigned long int) nl_langinfo (item->item_id);
-	    printf ("%d", val);
+	    if (show_keyword_name)
+	      printf ("%s=", item->name);
+
+	    printf ("%d\n", val);
 	  }
 	  break;
+	case wstring:
+	case wstringarray:
+	case wstringlist:
+	  /* We don't print wide character information since the same
+	     information is available in a multibyte string.  */
 	default:
 	}
-      putchar ('\n');
     }
 
   for (cat_no = 0; cat_no < NCATEGORIES; ++cat_no)