summaryrefslogtreecommitdiff
path: root/lib/canon-host.c
diff options
context:
space:
mode:
authorJim Meyering <jim@meyering.net>1999-01-11 02:46:33 +0000
committerJim Meyering <jim@meyering.net>1999-01-11 02:46:33 +0000
commitac25bd69bf9f9626028108a31a3cb6bc8691da8e (patch)
treeffa567962f5534c3910168bea3bdc8ec5e72a082 /lib/canon-host.c
parent87364848e20cfe8ead0e394a9d4d63f4a2a7044d (diff)
downloadcoreutils-ac25bd69bf9f9626028108a31a3cb6bc8691da8e.tar.xz
(main) [TEST_CANON_HOST]: Add a simple test driver.
Diffstat (limited to 'lib/canon-host.c')
-rw-r--r--lib/canon-host.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/lib/canon-host.c b/lib/canon-host.c
index db195385f..1f6b575ee 100644
--- a/lib/canon-host.c
+++ b/lib/canon-host.c
@@ -78,3 +78,17 @@ canon_host (const char *host)
#endif /* HAVE_GETHOSTBYNAME */
return 0;
}
+
+#ifdef TEST_CANON_HOST
+int
+main (int argc, char **argv)
+{
+ int i;
+ for (i = 1; i < argc; i++)
+ {
+ char *s = canon_host (argv[i]);
+ printf ("%s: %s\n", argv[i], (s ? s : "<undef>"));
+ }
+ exit (0);
+}
+#endif /* TEST_CANON_HOST */