From: David Levine Date: Fri, 6 Dec 2013 04:49:54 +0000 (-0600) Subject: Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh X-Git-Url: https://diplodocus.org/git/nmh/commitdiff_plain/32fde56da3936f39cd11a4eee52600164076e8e1?hp=7d7ed69eff25da303b3472f16a25289cf663b3f3 Merge branch 'master' of git.sv.nongnu.org:/srv/git/nmh --- diff --git a/.gitignore b/.gitignore index cb9f2017..8cca58d8 100644 --- a/.gitignore +++ b/.gitignore @@ -103,11 +103,11 @@ a.out.dSYM/ /uip/whatnow /uip/whom /uip/*.exe -/test/fakesmtp /test/fakepop -/test/getfullname -/test/getfqdn +/test/fakesmtp +/test/getcanon /test/getcwidth +/test/getfullname # Removed by mostlyclean: *.o diff --git a/Makefile.am b/Makefile.am index 13b6d448..bb3fc20c 100644 --- a/Makefile.am +++ b/Makefile.am @@ -92,7 +92,7 @@ TESTS = test/ali/test-ali test/anno/test-anno \ test/cleanup ## The "cleanup" test should always be last. check_SCRIPTS = test/common.sh -check_PROGRAMS = test/getfullname test/getfqdn test/fakepop test/fakesmtp \ +check_PROGRAMS = test/getfullname test/getcanon test/fakepop test/fakesmtp \ test/getcwidth DISTCHECK_CONFIGURE_FLAGS = DISABLE_SETGID_MAIL=1 @@ -427,8 +427,8 @@ uip_viamail_SOURCES = uip/viamail.c uip/mhmisc.c uip/mhoutsbr.c uip/sendsbr.c \ test_getfullname_SOURCES = test/getfullname.c test_getfullname_LDADD = sbr/libmh.a -test_getfqdn_SOURCES = test/getfqdn.c -test_getfqdn_LDADD = +test_getcanon_SOURCES = test/getcanon.c +test_getcanon_LDADD = test_fakepop_SOURCES = test/fakepop.c test_fakepop_LDADD = diff --git a/test/format/test-myhost b/test/format/test-myhost index 375f8ac5..2290f2a7 100755 --- a/test/format/test-myhost +++ b/test/format/test-myhost @@ -13,7 +13,7 @@ fi setup_test -host=`${MH_OBJ_DIR}/test/getfqdn` +host=`${MH_OBJ_DIR}/test/getcanon` run_test "${MH_LIB_DIR}/ap -format %(myhost) ignore" "$host" \ "local hostname test" diff --git a/test/format/test-mymbox b/test/format/test-mymbox index 040390c9..0221fad2 100755 --- a/test/format/test-mymbox +++ b/test/format/test-mymbox @@ -18,7 +18,7 @@ setup_test #### suite, or the user's login name. ap will escape (quote) it if #### needed. user=`${MH_LIB_DIR}/ap -format '%(me)' 0` -host=`${MH_OBJ_DIR}/test/getfqdn` +host=`${MH_OBJ_DIR}/test/getcanon` output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}"` run_test "echo $output" 1 "Basic user test" diff --git a/test/getfqdn.c b/test/getcanon.c similarity index 88% rename from test/getfqdn.c rename to test/getcanon.c index 2fee4852..8d7f15fd 100644 --- a/test/getfqdn.c +++ b/test/getcanon.c @@ -1,5 +1,5 @@ /* - * getfqdn.c - Print the FQDN of a host, default to localhost. + * getcanon.c - Print the canonical name of a host, default to localhost. * * This code is Copyright (c) 2012, by the authors of nmh. See the * COPYRIGHT file in the root directory of the nmh distribution for @@ -32,7 +32,7 @@ main(int argc, char *argv[]) } else if (argc == 2) { hostname = argv[1]; } else if (argc > 2) { - fprintf (stderr, "usage: %s [hostname]\n", argv[0]); + fprintf(stderr, "usage: %s [hostname]\n", argv[0]); return 1; } @@ -43,7 +43,7 @@ main(int argc, char *argv[]) hints.ai_family = AF_UNSPEC; if ((status = getaddrinfo(hostname, NULL, &hints, &res)) == 0) { - printf ("%s\n", res->ai_canonname); + printf("%s\n", res->ai_canonname); freeaddrinfo(res); } else { printf("%s\n", hostname);