summaryrefslogtreecommitdiff
path: root/localtime.c
diff options
context:
space:
mode:
authorDag-Erling Smørgrav <des@FreeBSD.org>2022-12-14 00:43:10 +0000
committerDag-Erling Smørgrav <des@FreeBSD.org>2022-12-14 00:43:10 +0000
commitcc16bfc34e07fede47a989d9552413c7b4d8e78e (patch)
treeee1329d113b0e03780f359d2c31e5106b872353e /localtime.c
parent5644220527212c50e368d67cdf927f7f854b03af (diff)
Import tzcode 2022fvendor/tzcode/tzcode2022f
Diffstat (limited to 'localtime.c')
-rw-r--r--localtime.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/localtime.c b/localtime.c
index 073b09669648..c556531a0a2e 100644
--- a/localtime.c
+++ b/localtime.c
@@ -802,12 +802,14 @@ typesequiv(const struct state *sp, int a, int b)
b < 0 || b >= sp->typecnt)
result = false;
else {
+ /* Compare the relevant members of *AP and *BP.
+ Ignore tt_ttisstd and tt_ttisut, as they are
+ irrelevant now and counting them could cause
+ sp->goahead to mistakenly remain false. */
register const struct ttinfo * ap = &sp->ttis[a];
register const struct ttinfo * bp = &sp->ttis[b];
result = (ap->tt_utoff == bp->tt_utoff
&& ap->tt_isdst == bp->tt_isdst
- && ap->tt_ttisstd == bp->tt_ttisstd
- && ap->tt_ttisut == bp->tt_ttisut
&& (strcmp(&sp->chars[ap->tt_desigidx],
&sp->chars[bp->tt_desigidx])
== 0));
@@ -1096,7 +1098,7 @@ transtime(const int year, register const struct rule *const rulep,
value += mon_lengths[leapyear][i] * SECSPERDAY;
break;
- default: UNREACHABLE();
+ default: unreachable();
}
/*