[BZ #4276]
[platform/upstream/glibc.git] / timezone / checktab.awk
index 9006e9f..80ad7d5 100644 (file)
@@ -1,6 +1,8 @@
 # Check tz tables for consistency.
 
-# Contributed by Paul Eggert <eggert@twinsun.com>.
+# @(#)checktab.awk     8.1
+
+# Contributed by Paul Eggert.
 
 BEGIN {
        FS = "\t"
@@ -13,7 +15,7 @@ BEGIN {
                iso_NR++
                if ($0 ~ /^#/) continue
                if (NF != 2) {
-                       printf "%s:%d: wrong number of columns\n",
+                       printf "%s:%d: wrong number of columns\n", \
                                iso_table, iso_NR >>"/dev/stderr"
                        status = 1
                }
@@ -25,9 +27,14 @@ BEGIN {
                        status = 1
                }
                if (cc <= cc0) {
+                       if (cc == cc0) {
+                               s = "duplicate";
+                       } else {
+                               s = "out of order";
+                       }
+
                        printf "%s:%d: country code `%s' is %s\n", \
-                               iso_table, iso_NR, cc, \
-                               cc==cc0 ? "duplicate"  : "out of order" \
+                               iso_table, iso_NR, cc, s \
                                >>"/dev/stderr"
                        status = 1
                }
@@ -50,7 +57,7 @@ BEGIN {
                zone_NR++
                if ($0 ~ /^#/) continue
                if (NF != 3 && NF != 4) {
-                       printf "%s:%d: wrong number of columns\n",
+                       printf "%s:%d: wrong number of columns\n", \
                                zone_table, zone_NR >>"/dev/stderr"
                        status = 1
                }
@@ -141,8 +148,8 @@ END {
        if (0 < want_warnings) {
                for (cc in cc2name) {
                        if (!cc_used[cc]) {
-                               printf "%s:%d: warning:" \
-                                       "no Zone entries for %s (%s)\n",
+                               printf "%s:%d: warning: " \
+                                       "no Zone entries for %s (%s)\n", \
                                        iso_table, cc2NR[cc], cc, cc2name[cc]
                        }
                }