about summary refs log tree commit diff
diff options
context:
space:
mode:
authorAndreas Schwab <schwab@suse.de>1999-03-20 17:04:42 +0000
committerAndreas Schwab <schwab@suse.de>1999-03-20 17:04:42 +0000
commitd16e36e0dc784d5bdce2f12ca365f5ecc7f76f46 (patch)
treee31786a2a734a1f4bf643e1c2d15af10e4a40f73
parente10cd1dc6a9bd9672e1eeec184f95e224b883ed7 (diff)
downloadglibc-cvs/libc-as-990326.tar.gz
glibc-cvs/libc-as-990326.tar.xz
glibc-cvs/libc-as-990326.zip
* time/tzfile.c (__tzfile_read): Handle the case where there are cvs/libc-as-990326
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.
-rw-r--r--ChangeLog5
-rw-r--r--time/tzfile.c19
2 files changed, 19 insertions, 5 deletions
diff --git a/ChangeLog b/ChangeLog
index b33c7d14e4..eb57aed755 100644
--- 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
diff --git a/time/tzfile.c b/time/tzfile.c
index e723892405..a7407316f3 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -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;