|
|
| 216 |
|
216 |
|
| 217 |
/* Clear out old state and reset to unnamed UTC. */ |
217 |
/* Clear out old state and reset to unnamed UTC. */ |
| 218 |
memset (tz_rules, 0, sizeof tz_rules); |
218 |
memset (tz_rules, 0, sizeof tz_rules); |
| 219 |
tz_rules[0].name = tz_rules[1].name = ""; |
219 |
tz_rules[0].name = tz_rules[1].name = "UTC"; |
| 220 |
|
220 |
|
| 221 |
/* Get the standard timezone name. */ |
221 |
/* Get the standard timezone name. */ |
| 222 |
tzbuf = strdupa (tz); |
222 |
tzbuf = strdupa (tz); |
|
|
| 225 |
(l = strlen (tzbuf)) < 3) |
225 |
(l = strlen (tzbuf)) < 3) |
| 226 |
goto out; |
226 |
goto out; |
| 227 |
|
227 |
|
| 228 |
tz_rules[0].name = __tzstring (tzbuf); |
|
|
| 229 |
|
| 230 |
tz += l; |
228 |
tz += l; |
| 231 |
|
229 |
|
| 232 |
/* Figure out the standard offset from UTC. */ |
230 |
/* Figure out the standard offset from UTC. */ |
| 233 |
if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit (*tz))) |
231 |
if (*tz == '\0' || (*tz != '+' && *tz != '-' && !isdigit (*tz))) |
| 234 |
goto out; |
232 |
goto out; |
| 235 |
|
233 |
|
|
|
234 |
tz_rules[0].name = __tzstring (tzbuf); |
| 235 |
|
| 236 |
if (*tz == '-' || *tz == '+') |
236 |
if (*tz == '-' || *tz == '+') |
| 237 |
tz_rules[0].offset = *tz++ == '-' ? 1L : -1L; |
237 |
tz_rules[0].offset = *tz++ == '-' ? 1L : -1L; |
| 238 |
else |
238 |
else |