<div dir="ltr"><div class="gmail_extra"><div class="gmail_quote">On Thu, Jan 5, 2017 at 2:37 AM, Paul Eggert <span dir="ltr">&lt;<a href="mailto:eggert@cs.ucla.edu" target="_blank">eggert@cs.ucla.edu</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex"><span class="gmail-">Bradley White wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">
One solution would be to trim trailing, no-op transitions from the end of<br>
the zic transitions before adding the rule-generated ones.  The reference<br>
implementation doesn&#39;t need them.<br>
</blockquote>
<br></span>
Thanks for catching that bug. The attached patch takes your suggestion for localtime.c. It also attempts to fix zic.c to not generate the incorrect transition in Pacific/Tongatapu in January 2038. Either part of the patch should suffice to fix the bug.<br>
</blockquote></div><br></div><div class="gmail_extra">Thanks.  I can verify that:</div><div class="gmail_extra"><br></div><div class="gmail_extra">(1) the zic.c change only affects Pacific/Tongatapu and Pacific/Fiji, and</div><div class="gmail_extra"><br></div><div class="gmail_extra">(2) the zic.c and/or the localtime.c changes fix the problem.</div><div class="gmail_extra"><br></div><div class="gmail_extra">Regarding the localtime.c change, perhaps something better than ignoring a transition that was &quot;almost surely generated&quot; because of WORK_AROUND_QTBUG_53071, is to just ignore any trailing, no-op transitions.  That is, ...</div><div class="gmail_extra"><br></div><div class="gmail_extra"><div class="gmail_extra">+                     /* Ignore any trailing, no-op transitions generated</div><div class="gmail_extra">+                      * by zic as they don&#39;t help here and can run afoul</div><div class="gmail_extra">+                      * of bugs in zic 2016j or earlier.  */</div><div class="gmail_extra">+                     while (1 &lt; sp-&gt;timecnt &amp;&amp;</div><div class="gmail_extra">+                            sp-&gt;types[sp-&gt;timecnt - 1] ==</div><div class="gmail_extra">+                                sp-&gt;types[sp-&gt;timecnt - 2])</div><div class="gmail_extra">+                       sp-&gt;timecnt--;</div></div><div class="gmail_extra"><br></div></div>