/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
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
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 =
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"
#### 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"
/*
- * 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
} 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;
}
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);