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

Commita330da4

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 parentde371e6 commita330da4

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
@@ -2792,30 +2792,15 @@ newabbr(const char *string)
27922792
constchar*cp;
27932793
char*wp;
27942794

2795-
/*
2796-
* Want one to ZIC_MAX_ABBR_LEN_WO_WARN alphabetics optionally
2797-
* followed by a + or - and a number from 1 to 14.
2798-
*/
27992795
cp=string;
28002796
wp=NULL;
2801-
while (isascii((unsignedchar)*cp)&&
2802-
isalpha((unsignedchar)*cp))
2797+
while (isalpha((unsignedchar)*cp)|| ('0' <=*cp&&*cp <='9')
2798+
||*cp=='-'||*cp=='+')
28032799
++cp;
2804-
if (cp-string==0)
2805-
wp=_("time zone abbreviation lacks alphabetic at start");
2806-
if (noise&&cp-string>3)
2807-
wp=_("time zone abbreviation has more than 3 alphabetics");
2800+
if (noise&&cp-string<3)
2801+
wp=_("time zone abbreviation has fewer than 3 characters");
28082802
if (cp-string>ZIC_MAX_ABBR_LEN_WO_WARN)
2809-
wp=_("time zone abbreviation has too many alphabetics");
2810-
if (wp==NULL&& (*cp=='+'||*cp=='-'))
2811-
{
2812-
++cp;
2813-
if (isascii((unsignedchar)*cp)&&
2814-
isdigit((unsignedchar)*cp))
2815-
if (*cp++=='1'&&
2816-
*cp >='0'&&*cp <='4')
2817-
++cp;
2818-
}
2803+
wp=_("time zone abbreviation has too many characters");
28192804
if (*cp!='\0')
28202805
wp=_("time zone abbreviation differs from POSIX standard");
28212806
if (wp!=NULL)

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp