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

Commit5968570

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 parent1021bd6 commit5968570

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
@@ -1766,7 +1766,25 @@ writezone(const char *name, const char *string)
17661766
if (pass==1)
17671767
puttzcode((long)ats[i],fp);
17681768
else
1769+
{
17691770
puttzcode64(ats[i],fp);
1771+
1772+
/* Print current timezone abbreviations if requested */
1773+
if (print_abbrevs&&
1774+
(ats[i] >=print_cutoff||i==thistimelim-1))
1775+
{
1776+
unsignedchartm=typemap[types[i]];
1777+
char*thisabbrev=&thischars[indmap[abbrinds[tm]]];
1778+
1779+
/* filter out assorted junk entries */
1780+
if (strcmp(thisabbrev,GRANDPARENTED)!=0&&
1781+
strcmp(thisabbrev,"zzz")!=0)
1782+
fprintf(stdout,"%s\t%ld%s\n",
1783+
thisabbrev,
1784+
gmtoffs[tm],
1785+
isdsts[tm] ?"\tD" :"");
1786+
}
1787+
}
17701788
for (i=thistimei;i<thistimelim;++i)
17711789
{
17721790
unsignedcharuc;
@@ -1783,21 +1801,6 @@ writezone(const char *name, const char *string)
17831801
puttzcode(gmtoffs[i],fp);
17841802
(void)putc(isdsts[i],fp);
17851803
(void)putc((unsignedchar)indmap[abbrinds[i]],fp);
1786-
1787-
/* Print current timezone abbreviations if requested */
1788-
if (print_abbrevs&&pass==2&&
1789-
(ats[i] >=print_cutoff||i==typecnt-1))
1790-
{
1791-
char*thisabbrev=&thischars[indmap[abbrinds[i]]];
1792-
1793-
/* filter out assorted junk entries */
1794-
if (strcmp(thisabbrev,GRANDPARENTED)!=0&&
1795-
strcmp(thisabbrev,"zzz")!=0)
1796-
fprintf(stdout,"%s\t%ld%s\n",
1797-
thisabbrev,
1798-
gmtoffs[i],
1799-
isdsts[i] ?"\tD" :"");
1800-
}
18011804
}
18021805
if (thischarcnt!=0)
18031806
(void)fwrite((void*)thischars,

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp