<div dir="ltr"><div>The attached change (which also appears in tab-mangled form below) dealt with the problem on the system I&#39;m using. It arranges things so that when the step-by-half-a-day time value goes over the maximum cutoff time, a final transition test is made.<br><br></div><div>(This seems better than excusing the behavior based on zdump.8&#39;s language about cutoffs being &quot;near the starts of the years.&quot;)<br></div><div><br></div>    @dashdashado<br><br>1.1<br>927 lines<br>1.2<br>927 lines<br>*** /tmp/,azdump.c    2014-09-06 19:56:41.335772400 -0400<br>--- /tmp/,bzdump.c    2014-09-06 19:56:41.423777400 -0400<br>***************<br>*** 654,665 ****<br>          tmp = my_localtime_rz(tz, &amp;t, &amp;tm);<br>          if (tmp)<br>            ab = saveabbr(&amp;abbrev, &amp;abbrevsize, &amp;tm);<br>!         for ( ; ; ) {<br>              newt = (t &lt; absolute_max_time - SECSPERDAY / 2<br>                  ? t + SECSPERDAY / 2<br>                  : absolute_max_time);<br>              if (cuthitime &lt;= newt)<br>!                 break;<br>              newtmp = localtime_rz(tz, &amp;newt, &amp;newtm);<br>              if ((tmp == NULL || newtmp == NULL) ? (tmp != newtmp) :<br>                  (delta(&amp;newtm, &amp;tm) != (newt - t) ||<br>--- 654,665 ----<br>          tmp = my_localtime_rz(tz, &amp;t, &amp;tm);<br>          if (tmp)<br>            ab = saveabbr(&amp;abbrev, &amp;abbrevsize, &amp;tm);<br>!         while (t &lt; cuthitime) {<br>              newt = (t &lt; absolute_max_time - SECSPERDAY / 2<br>                  ? t + SECSPERDAY / 2<br>                  : absolute_max_time);<br>              if (cuthitime &lt;= newt)<br>!                 newt = cuthitime;<br>              newtmp = localtime_rz(tz, &amp;newt, &amp;newtm);<br>              if ((tmp == NULL || newtmp == NULL) ? (tmp != newtmp) :<br>                  (delta(&amp;newtm, &amp;tm) != (newt - t) ||<br><br></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Sat, Sep 6, 2014 at 6:54 PM, Tim Parenti <span dir="ltr">&lt;<a href="mailto:tim@timtimeonline.com" target="_blank">tim@timtimeonline.com</a>&gt;</span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  

    
  
  <div bgcolor="#FFFFFF" text="#000000">
    <div>While sorting out some issues for tzdist, I noticed a bug in
      zdump, which is still present in 2014g.<br>
      <br>
    </div>
    <div>Running zdump on Asia/Singapore for both 1981 and 1982 together
      produces the expected transition from UTC+7:30 to UTC+8 at the
      boundary between those years:<br>
    </div>
    <div><br>
      <span style="font-family:courier new,monospace">$ ./zdump.exe
        -vc 1981,1983 Asia/Singapore<br>
        Asia/Singapore  -9223372036854775808 = NULL<br>
        Asia/Singapore  -9223372036854689408 = NULL<br>
        Asia/Singapore  Thu Dec 31 16:29:59 1981 UT = Thu Dec 31
        23:59:59 1981 SGT isdst=0<br>
        Asia/Singapore  Thu Dec 31 16:30:00 1981 UT = Fri Jan  1
        00:30:00 1982 SGT isdst=0<br>
        Asia/Singapore  9223372036854689407 = NULL<br>
        Asia/Singapore  9223372036854775807 = NULL</span><br>
    </div>
    <div><br>
    </div>
    <div>However, running it on 1981 and 1982 individually does not:<br>
    </div>
    <div><br>
      <span style="font-family:courier new,monospace">$ ./zdump.exe
        -vc 1981,1982 Asia/Singapore<br>
        Asia/Singapore  -9223372036854775808 = NULL<br>
        Asia/Singapore  -9223372036854689408 = NULL<br>
        Asia/Singapore  9223372036854689407 = NULL<br>
        Asia/Singapore  9223372036854775807 = NULL<br>
        <br>
        $ ./zdump.exe -vc 1982,1983 Asia/Singapore<br>
        Asia/Singapore  -9223372036854775808 = NULL<br>
        Asia/Singapore  -9223372036854689408 = NULL<br>
        Asia/Singapore  9223372036854689407 = NULL<br>
        Asia/Singapore  9223372036854775807 = NULL</span><br>
      <br>
    </div>
    <div>Initially, I thought this might have to do with the fact that
      the transition is specified as a Zone continuation line rather
      than as a Rule, since zdump properly handled my extended edge-case
      examples to Jon Skeet a while back:<br>
      <a href="http://mm.icann.org/pipermail/tz/2014-July/021162.html" target="_blank">http://mm.icann.org/pipermail/<u></u>tz/2014-July/021162.html</a><br>
      <br>
    </div>
    <div>zdump also properly handles Asia/Dhaka&#39;s DST transition at the
      end of 2009, but fails in some other similar cases. </div>
    <div><br>
    </div>
    So it looks like it&#39;s more to do with the transition taking place
    too close to the year boundary.  Part of the problem may be the
    transition happening in different years, UTC and local, but that
    doesn&#39;t seem to be all that&#39;s going on.<br>
    <br>
    Attached are some test cases to run against various versions of
    Singapore with 1981,1982 and 1982,1983; and various versions of
    Dhaka with 2009,2010 and 2010,2011.  All of these should work, but
    most currently don&#39;t.  (The ones that do are marked.)<span class="HOEnZb"><font color="#888888"><br>
    <pre cols="72">-- 
Tim Parenti</pre>
  </font></span></div>

</blockquote></div><br></div>