diff -ur tz2011j.build/zic.c tz2011j.mod1/zic.c --- tz2011j.build/zic.c 2011-06-15 11:46:58.000000000 +0100 +++ tz2011j.mod1/zic.c 2011-10-11 21:34:44.000000000 +0100 @@ -1951,12 +1951,15 @@ ** There are no rules running through "max". ** Let's find the latest rule. */ + zic_t when_latest = 0; for (i = 0; i < zp->z_nrules; ++i) { + zic_t when; rp = &zp->z_rules[i]; - if (stdrp == NULL || rp->r_hiyear > stdrp->r_hiyear || - (rp->r_hiyear == stdrp->r_hiyear && - rp->r_month > stdrp->r_month)) - stdrp = rp; + when = rpytime(rp, rp->r_hiyear); + if (stdrp == NULL || when > when_latest) { + stdrp = rp; + when_latest = when; + } } if (stdrp != NULL && stdrp->r_stdoff != 0) return; /* We end up in DST (a POSIX no-no). */