[tz] [PATCH 2/2] Improve logic of zic -v abbreviation-length check.

Paul Eggert eggert at cs.ucla.edu
Sun Nov 4 02:46:28 UTC 2012


This fixes a bunch of "time zone abbreviation has more than 3
alphabetics" diagnostics for 'make check_public'.
* zic.c (newabbr): Check for <3 alphabetics, not for >3.
POSIX-2008 requires at least 3 and says that it's not portable to
use more than 6, which we check elsewhere.
---
 zic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/zic.c b/zic.c
index 64af1b2..a9a54bb 100644
--- a/zic.c
+++ b/zic.c
@@ -2534,8 +2534,8 @@ newabbr(const char *const string)
 				++cp;
 		if (cp - string == 0)
 mp = _("time zone abbreviation lacks alphabetic at start");
-		if (noise && cp - string > 3)
-mp = _("time zone abbreviation has more than 3 alphabetics");
+		if (noise && cp - string < 3)
+mp = _("time zone abbreviation has fewer than 3 alphabetics");
 		if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
 mp = _("time zone abbreviation has too many alphabetics");
 		if (mp == NULL && (*cp == '+' || *cp == '-')) {
-- 
1.7.9.5




More information about the tz mailing list