diff options
author | Jim Meyering <jim@meyering.net> | 1999-01-11 02:46:33 +0000 |
---|---|---|
committer | Jim Meyering <jim@meyering.net> | 1999-01-11 02:46:33 +0000 |
commit | ac25bd69bf9f9626028108a31a3cb6bc8691da8e (patch) | |
tree | ffa567962f5534c3910168bea3bdc8ec5e72a082 /lib/canon-host.c | |
parent | 87364848e20cfe8ead0e394a9d4d63f4a2a7044d (diff) | |
download | coreutils-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.c | 14 |
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 */ |