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

Commit909e48d

Browse files
committed
Fix bogus logic for zic -P option.
The quick hack I added to zic to dump out currently-in-use timezoneabbreviations turns out to have a nasty bug: within each zone, it wasprinting the last "struct ttinfo" to be *defined*, not necessarily thelast one in use. This was mainly a problem in zones that had changed themeaning of their zone abbreviation (to another GMT offset value) and laterchanged it back.As a result of this error, we'd missed out updating the tznames/ filesfor some jurisdictions that have changed their zone abbreviations sincethe tznames/ files were originally created. I'll address the missing dataupdates in a separate commit.
1 parent67ed9d5 commit909e48d

File tree

1 file changed

+18
-15
lines changed

1 file changed

+18
-15
lines changed

‎src/timezone/zic.c

Lines changed: 18 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1770,7 +1770,25 @@ writezone(const char *name, const char *string)
17701770
if (pass==1)
17711771
puttzcode((long)ats[i],fp);
17721772
else
1773+
{
17731774
puttzcode64(ats[i],fp);
1775+
1776+
/* Print current timezone abbreviations if requested */
1777+
if (print_abbrevs&&
1778+
(ats[i] >=print_cutoff||i==thistimelim-1))
1779+
{
1780+
unsignedchartm=typemap[types[i]];
1781+
char*thisabbrev=&thischars[indmap[abbrinds[tm]]];
1782+
1783+
/* filter out assorted junk entries */
1784+
if (strcmp(thisabbrev,GRANDPARENTED)!=0&&
1785+
strcmp(thisabbrev,"zzz")!=0)
1786+
fprintf(stdout,"%s\t%ld%s\n",
1787+
thisabbrev,
1788+
gmtoffs[tm],
1789+
isdsts[tm] ?"\tD" :"");
1790+
}
1791+
}
17741792
for (i=thistimei;i<thistimelim;++i)
17751793
{
17761794
unsignedcharuc;
@@ -1787,21 +1805,6 @@ writezone(const char *name, const char *string)
17871805
puttzcode(gmtoffs[i],fp);
17881806
(void)putc(isdsts[i],fp);
17891807
(void)putc((unsignedchar)indmap[abbrinds[i]],fp);
1790-
1791-
/* Print current timezone abbreviations if requested */
1792-
if (print_abbrevs&&pass==2&&
1793-
(ats[i] >=print_cutoff||i==typecnt-1))
1794-
{
1795-
char*thisabbrev=&thischars[indmap[abbrinds[i]]];
1796-
1797-
/* filter out assorted junk entries */
1798-
if (strcmp(thisabbrev,GRANDPARENTED)!=0&&
1799-
strcmp(thisabbrev,"zzz")!=0)
1800-
fprintf(stdout,"%s\t%ld%s\n",
1801-
thisabbrev,
1802-
gmtoffs[i],
1803-
isdsts[i] ?"\tD" :"");
1804-
}
18051808
}
18061809
if (thischarcnt!=0)
18071810
(void)fwrite((void*)thischars,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp