Improve logic of zic -v abbreviation-length check.

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.
This commit is contained in:
Paul Eggert
2012-11-03 19:43:21 -07:00
parent cb66ad8326
commit 2577472467
+2 -2
View File
@@ -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 == '-')) {