aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorEdwin Groothuis <edwin@FreeBSD.org>2010-10-01 07:58:09 +0000
committerEdwin Groothuis <edwin@FreeBSD.org>2010-10-01 07:58:09 +0000
commitf9a33080297db49be3f1ec97f077663ebe4766a0 (patch)
treedd9618156620db243c9c2f14404c60ed328214ba
parentdfca6b5ed7757d91368c5aace6705a1678825db7 (diff)
downloadsrc-f9a33080297db49be3f1ec97f077663ebe4766a0.tar.gz
src-f9a33080297db49be3f1ec97f077663ebe4766a0.zip
Vendor import of tzcode2010mvendor/tzcode/tzcode2010m
Obtained from: ftp://elsie.nci.nih.gov/pub/
Notes
Notes: svn path=/vendor/tzcode/dist/; revision=213319 svn path=/vendor/tzcode/tzcode2010m/; revision=213320; tag=vendor/tzcode/tzcode2010m
-rw-r--r--zic/zic.c48
1 files changed, 47 insertions, 1 deletions
diff --git a/zic/zic.c b/zic/zic.c
index 484638a2cb5d..71ab562cf342 100644
--- a/zic/zic.c
+++ b/zic/zic.c
@@ -3,7 +3,7 @@
** 2006-07-17 by Arthur David Olson.
*/
-static char elsieid[] = "@(#)zic.c 8.20";
+static char elsieid[] = "@(#)zic.c 8.22";
#include "private.h"
#include "locale.h"
@@ -1621,6 +1621,52 @@ const char * const string;
if (thistimei == 0)
writetype[0] = TRUE;
}
+#ifndef LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH
+ /*
+ ** For some pre-2011 systems: if the last-to-be-written
+ ** standard (or daylight) type has an offset different from the
+ ** most recently used offset,
+ ** append an (unused) copy of the most recently used type
+ ** (to help get global "altzone" and "timezone" variables
+ ** set correctly).
+ */
+ {
+ register int mrudst, mrustd, hidst, histd, type;
+
+ hidst = histd = mrudst = mrustd = -1;
+ for (i = thistimei; i < thistimelim; ++i)
+ if (isdsts[types[i]])
+ mrudst = types[i];
+ else mrustd = types[i];
+ for (i = 0; i < typecnt; ++i)
+ if (writetype[i])
+ if (isdsts[i])
+ hidst = i;
+ else histd = i;
+ if (hidst >= 0 && mrudst >= 0 && hidst != mrudst &&
+ gmtoffs[hidst] != gmtoffs[mrudst]) {
+ isdsts[mrudst] = -1;
+ type = addtype(gmtoffs[mrudst],
+ &chars[abbrinds[mrudst]],
+ TRUE,
+ ttisstds[mrudst],
+ ttisgmts[mrudst]);
+ isdsts[mrudst] = TRUE;
+ writetype[type] = TRUE;
+ }
+ if (histd >= 0 && mrustd >= 0 && histd != mrustd &&
+ gmtoffs[histd] != gmtoffs[mrustd]) {
+ isdsts[mrustd] = -1;
+ type = addtype(gmtoffs[mrustd],
+ &chars[abbrinds[mrustd]],
+ FALSE,
+ ttisstds[mrustd],
+ ttisgmts[mrustd]);
+ isdsts[mrustd] = FALSE;
+ writetype[type] = TRUE;
+ }
+ }
+#endif /* !defined LEAVE_SOME_PRE_2011_SYSTEMS_IN_THE_LURCH */
thistypecnt = 0;
for (i = 0; i < typecnt; ++i)
typemap[i] = writetype[i] ? thistypecnt++ : -1;