1
0
mirror of https://frontier.innolan.net/rainlance/amiga-tz.git synced 2025-12-07 21:11:11 +00:00

olsona changes to handle both Paris and Chicago

SCCS-file: localtime.c
SCCS-SID: 7.77
This commit is contained in:
Arthur David Olson
2003-11-28 12:10:54 -05:00
committed by Paul Eggert
parent 358047d36e
commit c23ddb137f

View File

@ -1503,6 +1503,11 @@ const long offset;
register time_t t;
register const struct state * sp;
register int samei, otheri;
register int sameind, otherind;
register int i;
register int nseen;
int seen[TZ_MAX_TYPES];
int types[TZ_MAX_TYPES];
int okay;
if (tmp->tm_isdst > 1)
@ -1536,10 +1541,20 @@ const long offset;
if (sp == NULL)
return WRONG;
#endif /* defined ALL_STATE */
for (samei = sp->typecnt - 1; samei >= 0; --samei) {
for (i = 0; i < sp->typecnt; ++i)
seen[i] = FALSE;
nseen = 0;
for (i = sp->timecnt - 1; i >= 0; --i)
if (!seen[sp->types[i]]) {
seen[sp->types[i]] = TRUE;
types[nseen++] = sp->types[i];
}
for (sameind = 0; sameind < nseen; ++sameind) {
samei = types[sameind];
if (sp->ttis[samei].tt_isdst != tmp->tm_isdst)
continue;
for (otheri = sp->typecnt - 1; otheri >= 0; --otheri) {
for (otherind = 0; otherind < nseen; ++otherind) {
otheri = types[otherind];
if (sp->ttis[otheri].tt_isdst == tmp->tm_isdst)
continue;
tmp->tm_sec += sp->ttis[otheri].tt_gmtoff -