]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Sat, 17 Jul 2004 17:45:03 +0000 (17:45 +0000)
committerUlrich Drepper <drepper@redhat.com>
Sat, 17 Jul 2004 17:45:03 +0000 (17:45 +0000)
2004-07-17  Ulrich Drepper  <drepper@redhat.com>

* iconv/iconv_prog.c (print_known_names): Make machine-readable
output even less cluttered.

ChangeLog
iconv/iconv_prog.c

index 46a4c2b606ab7782a20416aef6b65a944d5bde8e..c1962a1c1712f6e9952f4fa4299728f303c907a6 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+2004-07-17  Ulrich Drepper  <drepper@redhat.com>
+
+       * iconv/iconv_prog.c (print_known_names): Make machine-readable
+       output even less cluttered.
+
 2004-07-16  Steven Munroe  <sjmunroe@us.ibm.com>
 
        [BZ #269]
index af823255b2efcef1e0a557f2b82024a85affda25..26b3c24f31d63b86a14a1e4708b1bb4257113f40 100644 (file)
@@ -770,7 +770,10 @@ print_known_names (void)
        add_known_names (modules);
     }
 
-  fputs (_("\
+  bool human_readable = isatty (fileno (stdout));
+
+  if (human_readable)
+    fputs (_("\
 The following list contain all the coded character sets known.  This does\n\
 not necessarily mean that all combinations of these names can be used for\n\
 the FROM and TO command line parameters.  One coded character set can be\n\
@@ -778,13 +781,8 @@ listed with several different names (aliases).\n\n  "), stdout);
 
   /* Now print the collected names.  */
   column = 2;
-  if (isatty (fileno (stdout)))
-    {
-      twalk (printlist, do_print_human);
+  twalk (printlist, human_readable ? do_print_human : do_print);
 
-      if (column != 0)
-       puts ("");
-    }
-  else
-    twalk (printlist, do_print);
+  if (human_readable && column != 0)
+    puts ("");
 }