diff options
author | 2008-03-31 14:16:53 +0000 | |
---|---|---|
committer | 2008-03-31 14:16:53 +0000 | |
commit | a3ac0a54a92947d20f2a25aab036d5d7d62eb019 (patch) | |
tree | a469e36aaede53493c188262070ff76fdae285b3 /lib/libc | |
parent | Update to tzdata2008b from elsie.nci.nih.gov (diff) | |
download | wireguard-openbsd-a3ac0a54a92947d20f2a25aab036d5d7d62eb019.tar.xz wireguard-openbsd-a3ac0a54a92947d20f2a25aab036d5d7d62eb019.zip |
Update to tzcode 2008a from elsie.nci.nih.gov
Diffstat (limited to 'lib/libc')
-rw-r--r-- | lib/libc/time/README | 6 | ||||
-rw-r--r-- | lib/libc/time/localtime.c | 29 |
2 files changed, 21 insertions, 14 deletions
diff --git a/lib/libc/time/README b/lib/libc/time/README index 90156361cbe..285b152dd72 100644 --- a/lib/libc/time/README +++ b/lib/libc/time/README @@ -1,5 +1,5 @@ -$OpenBSD: README,v 1.6 2007/02/06 19:35:16 millert Exp $ -@(#)README 8.1 +$OpenBSD: README,v 1.7 2008/03/31 14:16:53 millert Exp $ +@(#)README 8.2 "What time is it?" -- Richard Deacon as The King "Any time you want it to be." -- Frank Baxter as The Scientist @@ -66,7 +66,7 @@ Historical local time information has been included here to: system. The information in the time zone data files is by no means authoritative; -the files currently do not even attempt to covar all time stamps before +the files currently do not even attempt to cover all time stamps before 1970, and there are undoubtedly errors even for time stamps since 1970. If you know that the rules are different from those in a file, by all means feel free to change file (and please send the changed version to diff --git a/lib/libc/time/localtime.c b/lib/libc/time/localtime.c index bbb3f4cc224..8b4dc80dfa7 100644 --- a/lib/libc/time/localtime.c +++ b/lib/libc/time/localtime.c @@ -1,4 +1,4 @@ -/* $OpenBSD: localtime.c,v 1.33 2007/12/29 22:26:51 millert Exp $ */ +/* $OpenBSD: localtime.c,v 1.34 2008/03/31 14:16:53 millert Exp $ */ /* ** This file is in the public domain, so clarified as of ** 1996-06-05 by Arthur David Olson. @@ -557,16 +557,23 @@ register const int doextend; sp->ttis[sp->typecnt++] = ts.ttis[1]; } } - i = 2 * YEARSPERREPEAT; - sp->goback = sp->goahead = sp->timecnt > i; - sp->goback = sp->goback && - typesequiv(sp, sp->types[i], sp->types[0]) && - differ_by_repeat(sp->ats[i], sp->ats[0]); - sp->goahead = sp->goahead && - typesequiv(sp, sp->types[sp->timecnt - 1], - sp->types[sp->timecnt - 1 - i]) && - differ_by_repeat(sp->ats[sp->timecnt - 1], - sp->ats[sp->timecnt - 1 - i]); + sp->goback = sp->goahead = FALSE; + if (sp->timecnt > 1) { + for (i = 1; i < sp->timecnt; ++i) + if (typesequiv(sp, sp->types[i], sp->types[0]) && + differ_by_repeat(sp->ats[i], sp->ats[0])) { + sp->goback = TRUE; + break; + } + for (i = sp->timecnt - 2; i >= 0; --i) + if (typesequiv(sp, sp->types[sp->timecnt - 1], + sp->types[i]) && + differ_by_repeat(sp->ats[sp->timecnt - 1], + sp->ats[i])) { + sp->goahead = TRUE; + break; + } + } return 0; } |