]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
* time/tzfile.c (__tzfile_read): Handle the case where there are cvs/libc-as-990326
authorAndreas Schwab <schwab@suse.de>
Sat, 20 Mar 1999 17:04:42 +0000 (17:04 +0000)
committerAndreas Schwab <schwab@suse.de>
Sat, 20 Mar 1999 17:04:42 +0000 (17:04 +0000)
transitions but no DST.
1999-03-20  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>

* time/tzfile.c (__tzfile_read): Handle the case where there are
transitions but no DST.

ChangeLog
time/tzfile.c

index b33c7d14e42ad0d71cece0156331ce7c1d1aa9ab..eb57aed75580619f32b5301f8ef46b9b669016e9 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
+1999-03-20  Andreas Schwab  <schwab@issan.cs.uni-dortmund.de>
+
+       * time/tzfile.c (__tzfile_read): Handle the case where there are
+       transitions but no DST.
+
 1999-03-20  Roland McGrath  <roland@baalperazim.frob.com>
 
        * mach/Machrules (extra-libs-others): Add $(interface-library) here
index e723892405dad54c816a35b31a4d8a7753a42bd8..a7407316f37ec2241bdf5af70f7988d474f4ba37 100644 (file)
@@ -311,16 +311,25 @@ __tzfile_read (const char *file)
     rule_stdoff = rule_dstoff = types[0].offset;
   else
     {
+      int stdoff_set = 0, dstoff_set = 0;
       rule_stdoff = rule_dstoff = 0;
       for (i = 0; i < num_transitions; ++i)
        {
-         if (!rule_stdoff && !types[type_idxs[i]].isdst)
-           rule_stdoff = types[type_idxs[i]].offset;
-         if (!rule_dstoff && types[type_idxs[i]].isdst)
-           rule_dstoff = types[type_idxs[i]].offset;
-         if (rule_stdoff && rule_dstoff)
+         if (!stdoff_set && !types[type_idxs[i]].isdst)
+           {
+             stdoff_set = 1;
+             rule_stdoff = types[type_idxs[i]].offset;
+           }
+         if (!dstoff_set && types[type_idxs[i]].isdst)
+           {
+             dstoff_set = 1;
+             rule_dstoff = types[type_idxs[i]].offset;
+           }
+         if (stdoff_set && dstoff_set)
            break;
        }
+      if (!dstoff_set)
+       rule_dstoff = rule_stdoff;
     }
 
   __daylight = rule_stdoff != rule_dstoff;