]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
Update.
authorUlrich Drepper <drepper@redhat.com>
Fri, 20 Apr 2001 17:33:29 +0000 (17:33 +0000)
committerUlrich Drepper <drepper@redhat.com>
Fri, 20 Apr 2001 17:33:29 +0000 (17:33 +0000)
* iconv/iconv_prog.c (print_known_names): If printing goes not to
a tty print in a more machine-friendly way.

ChangeLog
iconv/iconv_prog.c

index ef4e0c0d1ce01f1883c3856230a06d6580f96910..0dde120a30429efb51fbbf154059e59c53c7ee3d 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,8 @@
 2001-04-20  Ulrich Drepper  <drepper@redhat.com>
 
+       * iconv/iconv_prog.c (print_known_names): If printing goes not to
+       a tty print in a more machine-friendly way.
+
        * sysdeps/ieee754/ldbl-128/e_asinl.c: New file.
        Contributed by Stephen L Moshier <moshier@mediaone.net>.
 
index 24521c06312d525e84054c4c3ed75e0590532efd..c1f99847005158cdfc8391445fc192ee00889683 100644 (file)
@@ -586,7 +586,7 @@ insert_print_list (const void *nodep, VISIT value, int level)
 }
 
 static void
-do_print  (const void *nodep, VISIT value, int level)
+do_print_human  (const void *nodep, VISIT value, int level)
 {
   if (value == leaf || value == postorder)
     {
@@ -627,6 +627,17 @@ do_print  (const void *nodep, VISIT value, int level)
     }
 }
 
+static void
+do_print  (const void *nodep, VISIT value, int level)
+{
+  if (value == leaf || value == postorder)
+    {
+      const char *s = *(const char **) nodep;
+
+      puts (s);
+    }
+}
+
 static void
 internal_function
 add_known_names (struct gconv_module *node)
@@ -672,8 +683,13 @@ listed with several different names (aliases).\n\n  "), stdout);
 
   /* Now print the collected names.  */
   column = 2;
-  twalk (printlist, do_print);
+  if (isatty (fileno (stdout)))
+    {
+      twalk (printlist, do_print_human);
 
-  if (column != 0)
-    puts ("");
+      if (column != 0)
+       puts ("");
+    }
+  else
+    twalk (printlist, do_print);
 }