mirror of
https://frontier.innolan.net/rainlance/amiga-tz.git
synced 2025-11-19 21:49:22 +00:00
Don't warn about abbreviations like '-05'
* NEWS, zic.8: Document this. * zic.c (newabbr): Allow abbreviations that (when quoted) conform to POSIX.1-2001 or later.
This commit is contained in:
4
NEWS
4
NEWS
@ -19,6 +19,10 @@ Unreleased, experimental changes
|
||||
installed data files for Europe/Simferopol and Europe/Tallinn.
|
||||
It does not affect timestamps. (Thanks to Howard Hinnant.)
|
||||
|
||||
Changes affecting code
|
||||
|
||||
zic no longer warns about valid time zone abbreviations like '-05'.
|
||||
|
||||
|
||||
Release 2015e - 2015-06-13 10:56:02 -0700
|
||||
|
||||
|
||||
2
zic.8
2
zic.8
@ -376,6 +376,8 @@ of the time zone abbreviation goes.
|
||||
Alternately,
|
||||
a slash (/)
|
||||
separates standard and daylight abbreviations.
|
||||
To conform to POSIX, a time zone abbreviation should contain only
|
||||
alphanumeric ASCII characters, "+" and "\*-".
|
||||
.TP
|
||||
.B UNTILYEAR [MONTH [DAY [TIME]]]
|
||||
The time at which the UT offset or the rule(s) change for a location.
|
||||
|
||||
20
zic.c
20
zic.c
@ -2893,27 +2893,15 @@ newabbr(const char *const string)
|
||||
register const char * cp;
|
||||
const char * mp;
|
||||
|
||||
/*
|
||||
** Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics
|
||||
** optionally followed by a + or - and a number from 1 to 14.
|
||||
*/
|
||||
cp = string;
|
||||
mp = NULL;
|
||||
while (is_alpha(*cp))
|
||||
while (is_alpha(*cp) || ('0' <= *cp && *cp <= '9')
|
||||
|| *cp == '-' || *cp == '+')
|
||||
++cp;
|
||||
if (cp - string == 0)
|
||||
mp = _("time zone abbreviation lacks alphabetic at start");
|
||||
if (noise && cp - string < 3)
|
||||
mp = _("time zone abbreviation has fewer than 3 alphabetics");
|
||||
mp = _("time zone abbreviation has fewer than 3 characters");
|
||||
if (cp - string > ZIC_MAX_ABBR_LEN_WO_WARN)
|
||||
mp = _("time zone abbreviation has too many alphabetics");
|
||||
if (mp == NULL && (*cp == '+' || *cp == '-')) {
|
||||
++cp;
|
||||
if (is_digit(*cp))
|
||||
if (*cp++ == '1' &&
|
||||
*cp >= '0' && *cp <= '4')
|
||||
++cp;
|
||||
}
|
||||
mp = _("time zone abbreviation has too many characters");
|
||||
if (*cp != '\0')
|
||||
mp = _("time zone abbreviation differs from POSIX standard");
|
||||
if (mp != NULL)
|
||||
|
||||
Reference in New Issue
Block a user