summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>2007-06-30 13:20:43 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>2007-06-30 13:20:43 +0000
commitf173f39f9f09921eba6733eccef2eca6b150491e (patch)
tree6a21cb3016f5424611a161e424251ed5f56de4c3
parentf64de6378e5db16488e477caf5f07bc24b7a5511 (diff)
Update to tzcode2007f from elsie.nci.nih.gov
-rw-r--r--lib/libc/time/Theory8
-rw-r--r--lib/libc/time/ialloc.c4
-rw-r--r--lib/libc/time/private.h6
-rw-r--r--lib/libc/time/tz-art.htm52
-rw-r--r--lib/libc/time/tz-link.htm16
-rw-r--r--lib/libc/time/zdump.c6
-rw-r--r--lib/libc/time/zic.86
-rw-r--r--lib/libc/time/zic.c56
8 files changed, 110 insertions, 44 deletions
diff --git a/lib/libc/time/Theory b/lib/libc/time/Theory
index 0ba9235f5f6..d5a9f5092c4 100644
--- a/lib/libc/time/Theory
+++ b/lib/libc/time/Theory
@@ -1,5 +1,5 @@
-$OpenBSD: Theory,v 1.12 2007/02/06 19:35:16 millert Exp $
-@(#)Theory 8.1
+$OpenBSD: Theory,v 1.13 2007/06/30 13:20:42 millert Exp $
+@(#)Theory 8.2
----- Outline -----
@@ -66,11 +66,11 @@ POSIX has the following properties and limitations.
where week 1 is the first week in which day d appears,
and `5' stands for the last week in which day d appears
(which may be either the 4th or 5th week).
-
+
Here is an example POSIX TZ string, for US Pacific time using rules
appropriate from 1987 through 2006:
- TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'
+ TZ='PST8PDT,M4.1.0/02:00,M10.5.0/02:00'
This POSIX TZ string is hard to remember, and mishandles time stamps
before 1987 and after 2006. With this package you can use this
diff --git a/lib/libc/time/ialloc.c b/lib/libc/time/ialloc.c
index 4de6ab915a6..1a110dd2bec 100644
--- a/lib/libc/time/ialloc.c
+++ b/lib/libc/time/ialloc.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ialloc.c,v 1.10 2005/08/08 08:05:38 espie Exp $ */
+/* $OpenBSD: ialloc.c,v 1.11 2007/06/30 13:20:42 millert Exp $ */
/*
** This file is in the public domain, so clarified as of
** Feb 14, 2003 by Arthur David Olson (arthur_david_olson@nih.gov).
@@ -59,7 +59,7 @@ const char * const new;
oldsize = strlen(old);
if ((result = irealloc(old, oldsize + newsize + 1)) != NULL)
if (new != NULL)
- (void) strlcpy(result + oldsize, new, newsize + 1);
+ (void) memcpy(result + oldsize, new, newsize + 1);
return result;
}
diff --git a/lib/libc/time/private.h b/lib/libc/time/private.h
index 933029fb6cb..869fe8603ca 100644
--- a/lib/libc/time/private.h
+++ b/lib/libc/time/private.h
@@ -1,4 +1,4 @@
-/* $OpenBSD: private.h,v 1.19 2007/02/06 19:35:16 millert Exp $ */
+/* $OpenBSD: private.h,v 1.20 2007/06/30 13:20:42 millert Exp $ */
#ifndef PRIVATE_H
#define PRIVATE_H
@@ -33,7 +33,7 @@
#if 0
#ifndef lint
#ifndef NOID
-static char privatehid[] = "@(#)private.h 8.2";
+static char privatehid[] = "@(#)private.h 8.3";
#endif /* !defined NOID */
#endif /* !defined lint */
#endif
@@ -360,7 +360,7 @@ char *ctime_r P((time_t const *, char *));
#ifndef SECSPERREPEAT
#define SECSPERREPEAT ((int_fast64_t) YEARSPERREPEAT * (int_fast64_t) AVGSECSPERYEAR)
#endif /* !defined SECSPERREPEAT */
-
+
#ifndef SECSPERREPEAT_BITS
#define SECSPERREPEAT_BITS 34 /* ceil(log2(SECSPERREPEAT)) */
#endif /* !defined SECSPERREPEAT_BITS */
diff --git a/lib/libc/time/tz-art.htm b/lib/libc/time/tz-art.htm
index c23c5176ff7..53ff94ec902 100644
--- a/lib/libc/time/tz-art.htm
+++ b/lib/libc/time/tz-art.htm
@@ -9,7 +9,7 @@ PUBLIC "-//W3C//DTD HTML 4.01//EN"
<body>
<h1>Time and the Arts</h1>
<address>
-@(#)tz-art.htm 8.5
+@(#)tz-art.htm 8.6
</address>
<p>
Please send corrections to this web page to the
@@ -178,6 +178,56 @@ Richard Teitelbaum, modular moog and micromoog synthesizer</td></tr>
<tr><td>Notes</td><td>Includes the song "Central Standard Time." Thanks to Colin Bowern for this information.</td></tr>
<tr><td><a href="http://www.allmusic.com/cg/amg.dll?p=amg&amp;sql=10:7ddovwvla9xk">AMG Rating</a></td><td>2.5 stars</td></tr>
<tr><td>&nbsp;</td></tr>
+
+<tr><td>Artist</td><td>Coldplay</td></tr>
+<tr><td>Song</td><td>Clocks</td></tr>
+<tr><td>Copyright Date</td><td>2003</td></tr>
+<tr><td>Label</td><td>Capitol Records</td></tr>
+<tr><td>ID</td><td>52608</td></tr>
+<tr><td>Total Time</td><td>4:13</td></tr>
+<tr><td>Notes</td><td>Won the 2004 Record of the Year honor at the
+Grammy Awards. Co-written and performed by Chris Martin,
+great-great-grandson of DST inventor William Willett. The song's first
+line is "Lights go out and I can't be saved".</td></tr>
+<td>&nbsp;</td></tr>
+
+<tr><td>Artist</td><td>Irving Kahal and Harry Richman</td></tr>
+<tr><td>Song</td><td>There Ought to be a Moonlight Saving Time</td></tr>
+<tr><td>Copyright Date</td><td>1931</td>
+<tr><td>Notes</td><td>This musical standard was a #1 hit for Guy Lombardo
+in 1931, and was also performed by Maurice Chevalier, Blossom Dearie
+and many others. The phrase "Moonlight saving time" also appears in
+the 1995 country song "Not Enough Hours in the Night" written by Aaron
+Barker, Kim Williams and Rob Harbin and performed by Doug
+Supernaw.</td></tr>
+<tr><td>&nbsp;</td></tr>
+
+<tr><td>TV episode title</td><td>The Lost Hour</td>
+<tr><td>TV series</td><td><em>Eerie, Indiana</em></td>
+<tr><td>TV episode number</td><td>10</td>
+<tr><td>Network</td><td>NBC</td>
+<tr><td>Air date</td><td>1991-12-01</td>
+<tr><td>Notes</td><td>Despite Indiana's then-lack of DST, Marshall changes his clock with unusual consequences.</td></tr>
+<tr><td>&nbsp;</td></tr>
+
+<tr><td>TV episode title</td><td>Time Tunnel</td>
+<tr><td>TV series</td><td><em>The Adventures of Pete &amp; Pete</em></td>
+<tr><td>TV episode number</td><td>5, season 2</td>
+<tr><td>Network</td><td>Nickelodeon</td>
+<tr><td>Air date</td><td>1994-10-23</td>
+<tr><td>Notes</td><td>The two Petes travel back in time an hour on the day that DST ends.</td></tr>
+<tr><td>&nbsp;</td></tr>
+
+<tr><td>TV episode title</td><td>King-Size Homer</td>
+<tr><td>TV series</td><td><em>The Simpsons</em></td>
+<tr><td>TV episode number</td><td>135</td>
+<tr><td>Network</td><td>Fox</td>
+<tr><td>Air date</td><td>1995-11-05</td>
+<tr><td>Notes</td><td>Homer, working from home, remarks "8:58, first
+time I've ever been early for work. Except for all those daylight
+savings days. Lousy farmers."</td></tr>
+<tr><td>&nbsp;</td></tr>
+
<tr><td>Artist</td><td>Jules Verne</td></tr>
<tr><td>Book</td><td>Le Tour du Monde en Quatre-Vingts Jours
(Around the World in Eighty Days)</td></tr>
diff --git a/lib/libc/time/tz-link.htm b/lib/libc/time/tz-link.htm
index c467df53f2f..ff3bc58ce2d 100644
--- a/lib/libc/time/tz-link.htm
+++ b/lib/libc/time/tz-link.htm
@@ -8,7 +8,7 @@
<meta http-equiv="Content-type" content='text/html; charset="US-ASCII"'>
<meta name="DC.Creator" content="Eggert, Paul">
<meta name="DC.Contributor" content="Olson, Arthur David">
-<meta name="DC.Date" content="2007-02-22">
+<meta name="DC.Date" content="2007-03-13">
<meta name="DC.Description"
content="Sources of information about time zones and daylight saving time">
<meta name="DC.Identifier" content="http://www.twinsun.com/tz/tz-link.htm">
@@ -18,7 +18,7 @@
<body>
<h1>Sources for Time Zone and Daylight Saving Time Data</h1>
<address>
-@(#)tz-link.htm 8.10
+@(#)tz-link.htm 8.11
</address>
<p>
Please send corrections to this web page to the
@@ -49,6 +49,7 @@ C Library</a> used in
<a href="http://www.cygwin.com/">Cygwin</a>,
<a href="http://www.delorie.com/djgpp/"><abbr
title="DJ's GNU Programming Platform">DJGPP</abbr></a>,
+<a href="http://www.ibm.com/servers/aix/">AIX</a>,
<a href="http://www.hp.com/products1/unix/operating/">HP-UX</a>,
<a href="http://www.sgi.com/developers/technology/irix/">IRIX</a>,
<a href="http://www.apple.com/macosx/">Mac OS X</a>,
@@ -176,13 +177,18 @@ href="http://www.w3.org/2000/01/foo">schema</a> was sketched out.</li>
<h2>Other <code>tz</code> compilers</h2>
<ul>
<li><a href="http://dialspace.dial.pipex.com/prod/dialspace/town/pipexdsl/s/asbm26/vzic/">Vzic iCalendar
-Timezone Converter</a> describes a program Vzic that compiles
+Timezone Converter</a> describes a <a
+href="http://en.wikipedia.org/wiki/C_%28programming_language%29">C</a>
+program that compiles
<code>tz</code> source into iCalendar-compatible VTIMEZONE files.
Vzic is freely
available under the <a
href="http://www.gnu.org/copyleft/gpl.html"><abbr>GNU</abbr>
General Public License (<abbr
title="General Public License">GPL</abbr>)</a>.</li>
+<li><a href="http://sourceforge.net/projects/tzical/">tziCal - tz
+database conversion utility</a> is like Vzic, except for the <a
+href="http://msdn.microsoft.com/netframework/">.NET framework</a>.</li>
<li><a
href="http://search.cpan.org/dist/DateTime-TimeZone/">DateTime::TimeZone</a>
contains a script <code>parse_olson</code> that compiles
@@ -392,10 +398,10 @@ Zone Concepts</a> discusses terminological issues behind time zones.</li>
<dd>The Parliamentary Library has commissioned <a
href="http://www.aph.gov.au/LIBRARY/Pubs/rn/2006-07/07rn13.pdf">research
note on daylight saving time in Australia</a>.
-The Bureau of Metrology publishes a list of
+The Bureau of Meteorology publishes a list of
<a href="http://www.bom.gov.au/climate/averages/tables/dst_times.shtml">Implementation Dates of Daylight Savings Time within Australia</a>.</dd>
<dt>Austria</dt>
-<dd>The Federal Office of Metrology and Surveying publishes a
+<dd>The National Metrology Institute publishes a
table of <a href="http://www.metrologie.at/pdf/sommerzeit.pdf"
hreflang="de">daylight saving time in Austria (in German)</a>.</dd>
<dt>Belgium</dt>
diff --git a/lib/libc/time/zdump.c b/lib/libc/time/zdump.c
index 30a8893dfc1..e1241209e24 100644
--- a/lib/libc/time/zdump.c
+++ b/lib/libc/time/zdump.c
@@ -1,8 +1,8 @@
-/* $OpenBSD: zdump.c,v 1.19 2007/02/06 19:35:16 millert Exp $ */
+/* $OpenBSD: zdump.c,v 1.20 2007/06/30 13:20:42 millert Exp $ */
/*
** This file is in the public domain, so clarified as of
** Feb 14, 2003 by Arthur David Olson.
-static char elsieid[] = "@(#)zdump.c 8.3";
+static char elsieid[] = "@(#)zdump.c 8.4";
/*
** This code has been made independent of the rest of the time
@@ -422,7 +422,7 @@ _("%s: use of -v on system with floating time_t other than float or double\n"),
t = t1;
t1 = 2 * t1 + 1;
}
-
+
absolute_max_time = t;
t = -t;
absolute_min_time = t - 1;
diff --git a/lib/libc/time/zic.8 b/lib/libc/time/zic.8
index 569b67bd853..c5982f09b13 100644
--- a/lib/libc/time/zic.8
+++ b/lib/libc/time/zic.8
@@ -1,5 +1,5 @@
-.\" $OpenBSD: zic.8,v 1.25 2007/05/31 19:19:34 jmc Exp $
-.Dd $Mdocdate: May 31 2007 $
+.\" $OpenBSD: zic.8,v 1.26 2007/06/30 13:20:42 millert Exp $
+.Dd $Mdocdate: June 30 2007 $
.Dt ZIC 8
.Os
.Sh NAME
@@ -443,6 +443,6 @@ produces a single transition to daylight saving at the new UTC offset
To get separate transitions
use multiple zone continuation lines
specifying transition instants using universal time.
-.\" @(#)zic.8 8.3
+.\" @(#)zic.8 8.4
.\" This file is in the public domain, so clarified as of
.\" 2003-02-14 by Arthur David Olson.
diff --git a/lib/libc/time/zic.c b/lib/libc/time/zic.c
index a7218ae8aba..2ea9df1e8b4 100644
--- a/lib/libc/time/zic.c
+++ b/lib/libc/time/zic.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: zic.c,v 1.28 2007/02/27 16:40:35 millert Exp $ */
+/* $OpenBSD: zic.c,v 1.29 2007/06/30 13:20:42 millert Exp $ */
/*
** This file is in the public domain, so clarified as of
** 2006-07-17 by Arthur David Olson.
@@ -117,7 +117,7 @@ static void associate P((void));
static int ciequal P((const char * ap, const char * bp));
static void convert P((long val, char * buf));
static void convert64 P((zic_t val, char * buf));
-static void dolink P((const char * fromfile, const char * tofile));
+static void dolink P((const char * fromfield, const char * tofield));
static void doabbr P((char * abbr, size_t size, const char * format,
const char * letters, int isdst, int doquotes));
static void eat P((const char * name, int num));
@@ -621,26 +621,26 @@ _("%s: More than one -L option specified\n"),
}
static void
-dolink(fromfile, tofile)
-const char * const fromfile;
-const char * const tofile;
+dolink(fromfield, tofield)
+const char * const fromfield;
+const char * const tofield;
{
register char * fromname;
register char * toname;
- if (fromfile[0] == '/')
- fromname = ecpyalloc(fromfile);
+ if (fromfield[0] == '/')
+ fromname = ecpyalloc(fromfield);
else {
fromname = ecpyalloc(directory);
fromname = ecatalloc(fromname, "/");
- fromname = ecatalloc(fromname, fromfile);
+ fromname = ecatalloc(fromname, fromfield);
}
- if (tofile[0] == '/')
- toname = ecpyalloc(tofile);
+ if (tofield[0] == '/')
+ toname = ecpyalloc(tofield);
else {
toname = ecpyalloc(directory);
toname = ecatalloc(toname, "/");
- toname = ecatalloc(toname, tofile);
+ toname = ecatalloc(toname, tofield);
}
/*
** We get to be careful here since
@@ -902,7 +902,8 @@ const char * string;
const char * const errstring;
const int signable;
{
- int hh, mm, ss, sign;
+ long hh;
+ int mm, ss, sign;
if (string == NULL || *string == '\0')
return 0;
@@ -912,27 +913,32 @@ const int signable;
sign = -1;
++string;
} else sign = 1;
- if (sscanf(string, scheck(string, "%d"), &hh) == 1)
+ if (sscanf(string, scheck(string, "%ld"), &hh) == 1)
mm = ss = 0;
- else if (sscanf(string, scheck(string, "%d:%d"), &hh, &mm) == 2)
+ else if (sscanf(string, scheck(string, "%ld:%d"), &hh, &mm) == 2)
ss = 0;
- else if (sscanf(string, scheck(string, "%d:%d:%d"),
+ else if (sscanf(string, scheck(string, "%ld:%d:%d"),
&hh, &mm, &ss) != 3) {
error(errstring);
return 0;
}
- if ((hh < 0 || hh >= HOURSPERDAY ||
+ if (hh < 0 ||
mm < 0 || mm >= MINSPERHOUR ||
- ss < 0 || ss > SECSPERMIN) &&
- !(hh == HOURSPERDAY && mm == 0 && ss == 0)) {
+ ss < 0 || ss > SECSPERMIN) {
error(errstring);
return 0;
}
- if (noise && hh == HOURSPERDAY)
+ if (LONG_MAX / SECSPERHOUR < hh) {
+ error(_("time overflow"));
+ return 0;
+ }
+ if (noise && hh == HOURSPERDAY && mm == 0 && ss == 0)
warning(_("24:00 not handled by pre-1998 versions of zic"));
- return eitol(sign) *
- (eitol(hh * MINSPERHOUR + mm) *
- eitol(SECSPERMIN) + eitol(ss));
+ if (noise && (hh > HOURSPERDAY ||
+ (hh == HOURSPERDAY && (mm != 0 || ss != 0))))
+warning(_("values over 24 hours not handled by pre-2007 versions of zic"));
+ return oadd(eitol(sign) * hh * eitol(SECSPERHOUR),
+ eitol(sign) * (eitol(mm) * eitol(SECSPERMIN) + eitol(ss)));
}
static void
@@ -2027,7 +2033,7 @@ const int zonecount;
wp = ecpyalloc(_("no POSIX environment variable for zone"));
wp = ecatalloc(wp, " ");
- wp = ecatalloc(wp, zpfirst->z_name);
+ wp = ecatalloc(wp, zpfirst->z_name);
warning(wp);
ifree(wp);
}
@@ -2283,6 +2289,10 @@ const int ttisgmt;
error(_("too many local time types"));
exit(EXIT_FAILURE);
}
+ if (! (-1L - 2147483647L <= gmtoff && gmtoff <= 2147483647L)) {
+ error(_("UTC offset out of range"));
+ exit(EXIT_FAILURE);
+ }
gmtoffs[i] = gmtoff;
isdsts[i] = isdst;
ttisstds[i] = ttisstd;