]> diplodocus.org Git - nmh/commitdiff
Renamed test/getfqdn to test/getcanon.
authorDavid Levine <levinedl@acm.org>
Fri, 6 Dec 2013 04:49:49 +0000 (22:49 -0600)
committerDavid Levine <levinedl@acm.org>
Fri, 6 Dec 2013 04:49:49 +0000 (22:49 -0600)
.gitignore
Makefile.am
test/format/test-myhost
test/format/test-mymbox
test/getcanon.c [moved from test/getfqdn.c with 88% similarity]

index cb9f2017194ecedee7953bcd96bdb5c6f4c48aec..8cca58d88d9890b3658aec3b40c3029c02f366b3 100644 (file)
@@ -103,11 +103,11 @@ a.out.dSYM/
 /uip/whatnow
 /uip/whom
 /uip/*.exe
 /uip/whatnow
 /uip/whom
 /uip/*.exe
-/test/fakesmtp
 /test/fakepop
 /test/fakepop
-/test/getfullname
-/test/getfqdn
+/test/fakesmtp
+/test/getcanon
 /test/getcwidth
 /test/getcwidth
+/test/getfullname
 
 # Removed by mostlyclean:
 *.o
 
 # Removed by mostlyclean:
 *.o
index 13b6d448aea69f60fd997fbeffd05ff3a93dfd75..bb3fc20cfd2275ee1e4dea57a9ee6805b32a1842 100644 (file)
@@ -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
        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/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_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 =
 
 test_fakepop_SOURCES = test/fakepop.c
 test_fakepop_LDADD =
index 375f8ac511f5954faf10a9a85df3d128b2a5e213..2290f2a7c5ceb2df3e4e430bf935ae0d8096afa0 100755 (executable)
@@ -13,7 +13,7 @@ fi
 
 setup_test
 
 
 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"
 
 run_test "${MH_LIB_DIR}/ap -format %(myhost) ignore" "$host" \
          "local hostname test"
 
index 040390c95380b8c4969714cf142f4b634c3eaea7..0221fad2a88277a21e5235d85f85b2258828caff 100755 (executable)
@@ -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`
 #### 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"
 
 output=`${MH_LIB_DIR}/ap -format '%(mymbox{text})' "${user}"`
 run_test "echo $output" 1 "Basic user test"
similarity index 88%
rename from test/getfqdn.c
rename to test/getcanon.c
index 2fee4852052caff129d32a33735e2f8b841593bf..8d7f15fdc4163b322cda795041a91d2cf7e6e324 100644 (file)
@@ -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
  *
  * 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) {
   } 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;
   }
 
     return 1;
   }
 
@@ -43,7 +43,7 @@ main(int argc, char *argv[])
     hints.ai_family = AF_UNSPEC;
 
     if ((status = getaddrinfo(hostname, NULL, &hints, &res)) == 0) {
     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);
       freeaddrinfo(res);
     } else {
       printf("%s\n", hostname);