summary refs log tree commit diff
path: root/time/tzfile.c
diff options
context:
space:
mode:
authorUlrich Drepper <drepper@redhat.com>1998-09-10 11:58:53 +0000
committerUlrich Drepper <drepper@redhat.com>1998-09-10 11:58:53 +0000
commit90865aa8d319b1bd736690717c6fcc23b7a29e98 (patch)
treedb9e3601dddee40e5c49d7569721334ecf51b451 /time/tzfile.c
parentadac8450947aa7963df1ff143fa64e6579a0f620 (diff)
downloadglibc-90865aa8d319b1bd736690717c6fcc23b7a29e98.tar.gz
glibc-90865aa8d319b1bd736690717c6fcc23b7a29e98.tar.xz
glibc-90865aa8d319b1bd736690717c6fcc23b7a29e98.zip
Update.
1998-09-10 11:53  Ulrich Drepper  <drepper@cygnus.com>

	* timezone/Makefile: Add rules to generate Asia/Tokyo zoneinfo files
	for test.
	* timezone/tst-timezone.c (tests): Fix typo in last patch.

	* time/tzfile.c (__tzfile_read): Handle case when there are no
	transitions.  Set __timezone based on computed offset.
	* time/tzset.c (tzset_internal): Set __timezone before returning.

	* time/tzset.c (tzset_internal): Optimize handling of local string
	copy.

1998-09-10  Andreas Jaeger  <aj@arthur.rhein-neckar.de>

	* timezone/tst-timezone.c (tests): Add test for Asia/Tokyo (see PR
	libc/776).

	* sysdeps/powerpc/bits/fenv.h: Add parens.
Diffstat (limited to 'time/tzfile.c')
-rw-r--r--time/tzfile.c25
1 files changed, 17 insertions, 8 deletions
diff --git a/time/tzfile.c b/time/tzfile.c
index eca09e2bbb..a7753d2f73 100644
--- a/time/tzfile.c
+++ b/time/tzfile.c
@@ -281,15 +281,21 @@ __tzfile_read (const char *file)
 
   compute_tzname_max (chars);
 
-  rule_stdoff = rule_dstoff = 0;
-  for (i = 0; i < num_transitions; ++i)
+  if (num_transitions == 0)
+    /* Use the first rule (which should also be the only one.  */
+    rule_stdoff = rule_dstoff = types[0].offset;
+  else
     {
-      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)
-	break;
+      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)
+	    break;
+	}
     }
 
   __daylight = rule_stdoff != rule_dstoff;
@@ -381,6 +387,9 @@ __tzfile_default (const char *std, const char *dst,
   __tzname[0] = (char *) std;
   __tzname[1] = (char *) dst;
 
+  /* Set the timezone.  */
+  __timezone = -types[0].offset;
+
   compute_tzname_max (stdlen + dstlen);
 }