]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
If time to switch to DST is later in the year switch back in the next
authorUlrich Drepper <drepper@redhat.com>
Mon, 26 Oct 1998 14:07:43 +0000 (14:07 +0000)
committerUlrich Drepper <drepper@redhat.com>
Mon, 26 Oct 1998 14:07:43 +0000 (14:07 +0000)
year.

time/tzset.c

index 671c6103d50b0a757ac16e2d0c44221097d9de6c..970bbecd4495fc14c8708639dad2ce4eac084a53 100644 (file)
@@ -548,6 +548,13 @@ tz_compute (timer, tm)
   if (! compute_change (&tz_rules[0], 1900 + tm->tm_year) ||
       ! compute_change (&tz_rules[1], 1900 + tm->tm_year))
     return 0;
+  /* We have to distinguish between northern and southern hemisphere.
+     For the later the daylight saving time ends in the next year.
+     It is easier to detect this after first computing the time for the
+     wrong year since now we simply can compare the times to switch.  */
+  if (tz_rules[0].change > tz_rules[1].change
+      && ! compute_change (&tz_rules[1], 1900 + tm->tm_year + 1))
+    return 0;
 
   __daylight = tz_rules[0].offset != tz_rules[1].offset;
   __timezone = -tz_rules[0].offset;