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>.
}
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)
{
}
}
+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)
/* 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);
}