From: Ulrich Drepper Date: Thu, 10 Sep 1998 14:51:55 +0000 (+0000) Subject: (tzset_internal): Set __timezone before returning. X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=247c6b0614bbcc8b3c5488ad4e7ef35daf8ef6a3;p=thirdparty%2Fglibc.git (tzset_internal): Set __timezone before returning. --- diff --git a/time/tzset.c b/time/tzset.c index 0c2084ce1d9..671c6103d50 100644 --- a/time/tzset.c +++ b/time/tzset.c @@ -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; } /* Maximum length of a timezone name. __tz_compute keeps this up to date