]> git.ipfire.org Git - thirdparty/glibc.git/commitdiff
(tzset_internal): Set __timezone before returning.
authorUlrich Drepper <drepper@redhat.com>
Thu, 10 Sep 1998 14:51:55 +0000 (14:51 +0000)
committerUlrich Drepper <drepper@redhat.com>
Thu, 10 Sep 1998 14:51:55 +0000 (14:51 +0000)
time/tzset.c

index 0c2084ce1d97863db3bef29c1c2586bdfa3006c7..671c6103d50b0a757ac16e2d0c44221097d9de6c 100644 (file)
@@ -334,7 +334,7 @@ tzset_internal (always)
       tz_rules[1].name = tz_rules[0].name;
       tz_rules[1].offset = tz_rules[0].offset;
       free (tzbuf);
-      return;
+      goto out;
     }
 
  done_names:
@@ -355,12 +355,12 @@ tzset_internal (always)
          char *end;
          tzr->type = *tz == 'J' ? J1 : J0;
          if (tzr->type == J1 && !isdigit (*++tz))
-           return;
+           goto out;
          tzr->d = (unsigned short int) strtoul (tz, &end, 10);
          if (end == tz || tzr->d > 365)
-           return;
+           goto out;
          else if (tzr->type == J1 && tzr->d == 0)
-           return;
+           goto out;
          tz = end;
        }
       else if (*tz == 'M')
@@ -371,7 +371,7 @@ tzset_internal (always)
                      &tzr->m, &tzr->n, &tzr->d, &n) != 3 ||
              tzr->m < 1 || tzr->m > 12 ||
              tzr->n < 1 || tzr->n > 5 || tzr->d > 6)
-           return;
+           goto out;
          tz += n;
        }
       else if (*tz == '\0')
@@ -392,16 +392,16 @@ tzset_internal (always)
            }
        }
       else
-       return;
+       goto out;
 
       if (*tz != '\0' && *tz != '/' && *tz != ',')
-       return;
+       goto out;
       else if (*tz == '/')
        {
          /* Get the time of day of the change.  */
          ++tz;
          if (*tz == '\0')
-           return;
+           goto out;
          switch (sscanf (tz, "%hu:%hu:%hu", &hh, &mm, &ss))
            {
            default:
@@ -428,6 +428,10 @@ tzset_internal (always)
 
       tzr->computed_for = -1;
     }
+
+ out:
+  /* We know the offset now, set `__timezone'.  */
+  __timezone = -tz_rules[0].offset;
 }
 \f
 /* Maximum length of a timezone name.  __tz_compute keeps this up to date