diff options
author | Ulrich Drepper <drepper@redhat.com> | 1998-09-10 14:51:55 +0000 |
---|---|---|
committer | Ulrich Drepper <drepper@redhat.com> | 1998-09-10 14:51:55 +0000 |
commit | 247c6b0614bbcc8b3c5488ad4e7ef35daf8ef6a3 (patch) | |
tree | 7e68820a67a99c269a37d695280fa80f908c0529 /time | |
parent | 0fdf7aeb83746b84aa77da9299592e81bd97e2ee (diff) | |
download | glibc-247c6b0614bbcc8b3c5488ad4e7ef35daf8ef6a3.tar.gz glibc-247c6b0614bbcc8b3c5488ad4e7ef35daf8ef6a3.tar.xz glibc-247c6b0614bbcc8b3c5488ad4e7ef35daf8ef6a3.zip |
(tzset_internal): Set __timezone before returning.
Diffstat (limited to 'time')
-rw-r--r-- | time/tzset.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/time/tzset.c b/time/tzset.c index 0c2084ce1d..671c6103d5 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 |