* localtime.cc (tzload): Fix loading latest timezone offsets into
tzinfo from zoneinfo files. Add comment to explain what we do. (tzparse): Add more comments to explain in case of loading timezone offset from other sources.
This commit is contained in:
parent
6a35dbf342
commit
80d9bfa9a8
File diff suppressed because it is too large
Load Diff
2745
winsup/cygwin/ChangeLog-2014
Normal file
2745
winsup/cygwin/ChangeLog-2014
Normal file
File diff suppressed because it is too large
Load Diff
@ -900,12 +900,18 @@ tzload(timezone_t sp, const char *name, const int doextend)
|
||||
}
|
||||
}
|
||||
free(up);
|
||||
/*
|
||||
** Get latest zone offsets into tzinfo (for newlib). . .
|
||||
*/
|
||||
if (sp == lclptr)
|
||||
{
|
||||
__gettzinfo ()->__tzrule[0].offset
|
||||
= -sp->ttis[1].tt_gmtoff;
|
||||
__gettzinfo ()->__tzrule[1].offset
|
||||
= -sp->ttis[0].tt_gmtoff;
|
||||
for (i = 0; i < sp->timecnt; ++i)
|
||||
{
|
||||
const struct ttinfo *const ttisp = &sp->ttis[sp->types[i]];
|
||||
|
||||
__gettzinfo ()->__tzrule[ttisp->tt_isdst].offset
|
||||
= -ttisp->tt_gmtoff;
|
||||
}
|
||||
}
|
||||
return 0;
|
||||
oops:
|
||||
@ -1355,6 +1361,9 @@ tzparse(timezone_t sp, const char *name, const int lastditch)
|
||||
break;
|
||||
janfirst = newfirst;
|
||||
}
|
||||
/*
|
||||
** Get zone offsets into tzinfo (for newlib). . .
|
||||
*/
|
||||
if (sp == lclptr)
|
||||
{
|
||||
__gettzinfo ()->__tzrule[0].offset
|
||||
@ -1447,6 +1456,9 @@ tzparse(timezone_t sp, const char *name, const int lastditch)
|
||||
sp->ttis[1].tt_isdst = TRUE;
|
||||
sp->ttis[1].tt_abbrind = (int)(stdlen + 1);
|
||||
sp->typecnt = 2;
|
||||
/*
|
||||
** Get zone offsets into tzinfo (for newlib). . .
|
||||
*/
|
||||
if (sp == lclptr)
|
||||
{
|
||||
__gettzinfo ()->__tzrule[0].offset
|
||||
@ -1463,6 +1475,9 @@ tzparse(timezone_t sp, const char *name, const int lastditch)
|
||||
sp->ttis[0].tt_gmtoff = -stdoffset;
|
||||
sp->ttis[0].tt_isdst = 0;
|
||||
sp->ttis[0].tt_abbrind = 0;
|
||||
/*
|
||||
** Get zone offsets into tzinfo (for newlib). . .
|
||||
*/
|
||||
if (sp == lclptr)
|
||||
{
|
||||
__gettzinfo ()->__tzrule[0].offset = -sp->ttis[0].tt_gmtoff;
|
||||
|
Loading…
Reference in New Issue
Block a user