Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit8ea71fd

Browse files
committed
Modernize zic's test for valid timezone abbreviations.
We really need to sync all of our IANA-derived timezone code with upstream,but that's going to be a large patch and I certainly don't care to shovesuch a thing into stable branches immediately before a release. As astopgap, copy just the tzcode2016c logic that checks validity of timezoneabbreviations. This prevents getting multiple "time zone abbreviationdiffers from POSIX standard" bleats with tzdata 2014b and later.
1 parent8e16592 commit8ea71fd

File tree

1 file changed

+5
-20
lines changed

1 file changed

+5
-20
lines changed

‎src/timezone/zic.c

Lines changed: 5 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -2796,30 +2796,15 @@ newabbr(const char *string)
27962796
constchar*cp;
27972797
char*wp;
27982798

2799-
/*
2800-
* Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics optionally
2801-
* followed by a + or - and a number from 1 to 14.
2802-
*/
28032799
cp=string;
28042800
wp=NULL;
2805-
while (isascii((unsignedchar)*cp)&&
2806-
isalpha((unsignedchar)*cp))
2801+
while (isalpha((unsignedchar)*cp)|| ('0' <=*cp&&*cp <='9')
2802+
||*cp=='-'||*cp=='+')
28072803
++cp;
2808-
if (cp-string==0)
2809-
wp=_("time zone abbreviation lacks alphabetic at start");
2810-
if (noise&&cp-string>3)
2811-
wp=_("time zone abbreviation has more than 3 alphabetics");
2804+
if (noise&&cp-string<3)
2805+
wp=_("time zone abbreviation has fewer than 3 characters");
28122806
if (cp-string>ZIC_MAX_ABBR_LEN_WO_WARN)
2813-
wp=_("time zone abbreviation has too many alphabetics");
2814-
if (wp==NULL&& (*cp=='+'||*cp=='-'))
2815-
{
2816-
++cp;
2817-
if (isascii((unsignedchar)*cp)&&
2818-
isdigit((unsignedchar)*cp))
2819-
if (*cp++=='1'&&
2820-
*cp >='0'&&*cp <='4')
2821-
++cp;
2822-
}
2807+
wp=_("time zone abbreviation has too many characters");
28232808
if (*cp!='\0')
28242809
wp=_("time zone abbreviation differs from POSIX standard");
28252810
if (wp!=NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp