* 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);
|
free(up);
|
||||||
|
/*
|
||||||
|
** Get latest zone offsets into tzinfo (for newlib). . .
|
||||||
|
*/
|
||||||
if (sp == lclptr)
|
if (sp == lclptr)
|
||||||
{
|
{
|
||||||
__gettzinfo ()->__tzrule[0].offset
|
for (i = 0; i < sp->timecnt; ++i)
|
||||||
= -sp->ttis[1].tt_gmtoff;
|
{
|
||||||
__gettzinfo ()->__tzrule[1].offset
|
const struct ttinfo *const ttisp = &sp->ttis[sp->types[i]];
|
||||||
= -sp->ttis[0].tt_gmtoff;
|
|
||||||
|
__gettzinfo ()->__tzrule[ttisp->tt_isdst].offset
|
||||||
|
= -ttisp->tt_gmtoff;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
oops:
|
oops:
|
||||||
@ -1355,6 +1361,9 @@ tzparse(timezone_t sp, const char *name, const int lastditch)
|
|||||||
break;
|
break;
|
||||||
janfirst = newfirst;
|
janfirst = newfirst;
|
||||||
}
|
}
|
||||||
|
/*
|
||||||
|
** Get zone offsets into tzinfo (for newlib). . .
|
||||||
|
*/
|
||||||
if (sp == lclptr)
|
if (sp == lclptr)
|
||||||
{
|
{
|
||||||
__gettzinfo ()->__tzrule[0].offset
|
__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_isdst = TRUE;
|
||||||
sp->ttis[1].tt_abbrind = (int)(stdlen + 1);
|
sp->ttis[1].tt_abbrind = (int)(stdlen + 1);
|
||||||
sp->typecnt = 2;
|
sp->typecnt = 2;
|
||||||
|
/*
|
||||||
|
** Get zone offsets into tzinfo (for newlib). . .
|
||||||
|
*/
|
||||||
if (sp == lclptr)
|
if (sp == lclptr)
|
||||||
{
|
{
|
||||||
__gettzinfo ()->__tzrule[0].offset
|
__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_gmtoff = -stdoffset;
|
||||||
sp->ttis[0].tt_isdst = 0;
|
sp->ttis[0].tt_isdst = 0;
|
||||||
sp->ttis[0].tt_abbrind = 0;
|
sp->ttis[0].tt_abbrind = 0;
|
||||||
|
/*
|
||||||
|
** Get zone offsets into tzinfo (for newlib). . .
|
||||||
|
*/
|
||||||
if (sp == lclptr)
|
if (sp == lclptr)
|
||||||
{
|
{
|
||||||
__gettzinfo ()->__tzrule[0].offset = -sp->ttis[0].tt_gmtoff;
|
__gettzinfo ()->__tzrule[0].offset = -sp->ttis[0].tt_gmtoff;
|
||||||
|
Loading…
Reference in New Issue
Block a user