* localtime.cc (time2): Change "spring gap" to "spring forward gap"

in comment.
This commit is contained in:
Corinna Vinschen 2009-06-12 15:08:43 +00:00
parent 7ce08eab6c
commit c3d7820d5b
2 changed files with 10 additions and 5 deletions

View File

@ -1,7 +1,12 @@
2009-06-12 Corinna Vinschen <corinna@vinschen.de> 2009-06-12 Corinna Vinschen <corinna@vinschen.de>
* localtime.cc (time2): Add workaround for spring gap problem. Add * localtime.cc (time2): Change "spring gap" to "spring forward gap"
explaining comment. in comment.
2009-06-12 Corinna Vinschen <corinna@vinschen.de>
* localtime.cc (time2): Add workaround for spring forward gap problem.
Add explaining comment.
2009-06-12 Corinna Vinschen <corinna@vinschen.de> 2009-06-12 Corinna Vinschen <corinna@vinschen.de>

View File

@ -1994,13 +1994,13 @@ time2(struct tm *tmp, void (*funcp) P((const time_t*, long, struct tm*)),
t = time2sub(tmp, funcp, offset, okayp, true); t = time2sub(tmp, funcp, offset, okayp, true);
if (*okayp) if (*okayp)
return t; return t;
/* Workaround for the spring gap problem which results in the /* Workaround for the spring forward gap problem which results in
autoconf mktime usability test failing. the autoconf mktime usability test failing.
What we do here is this: The gap has 3600 seconds. If we What we do here is this: The gap has 3600 seconds. If we
subtract 3600 from the tm_sec value and get a valid result, subtract 3600 from the tm_sec value and get a valid result,
then we can simply add 3600 to the return value and are done. then we can simply add 3600 to the return value and are done.
If the result is still not valid, the problem is not the If the result is still not valid, the problem is not the
spring gap and we can give up. */ spring forward gap and we can give up. */
struct tm tmp2 = *tmp; struct tm tmp2 = *tmp;
tmp2.tm_sec -= 3600; tmp2.tm_sec -= 3600;
t = time2sub(&tmp2, funcp, offset, okayp, true); t = time2sub(&tmp2, funcp, offset, okayp, true);