proposed changes to zdump.c and systemv
Arthur David Olson
olsona at lecserver.nci.nih.gov
Tue Nov 29 16:31:43 UTC 2005
Below find proposed changes to zdump.c to eliminate some lint and to
remove an electronic mail address (in our current age of address
hunting-and-abusing software; more address elimination is to follow).
Also find changes to systemv; the file is left in place, but without any
active "Zone" lines so now binary data is generated. I've uncommented the
"Rule" lines to provide a continuing check of their validity (in case the
input accepted by "zic" changes) and to minimize the changes needed should
someone actually want to generate System V time zone files.
--ado
------- zdump.c -------
*** /tmp/geta62 Tue Nov 29 11:21:35 2005
--- /tmp/getb62 Tue Nov 29 11:21:35 2005
***************
*** 1,4 ****
! static char elsieid[] = "@(#)zdump.c 7.68";
/*
** This code has been made independent of the rest of the time
--- 1,4 ----
! static char elsieid[] = "@(#)zdump.c 7.69";
/*
** This code has been made independent of the rest of the time
***************
*** 12,17 ****
--- 12,21 ----
#include "time.h" /* for struct tm */
#include "stdlib.h" /* for exit, malloc, atoi */
#include "float.h" /* for FLT_MAX and DBL_MAX */
+ #include "ctype.h" /* for isalpha et al. */
+ #ifndef isascii
+ #define isascii(x) 1
+ #endif
#ifndef ZDUMP_LO_YEAR
#define ZDUMP_LO_YEAR (-500)
***************
*** 205,211 ****
return;
cp = abbrp;
wp = NULL;
! while (isascii(*cp) && isalpha(*cp))
++cp;
if (cp - abbrp == 0)
wp = _("lacks alphabetic at start");
--- 209,215 ----
return;
cp = abbrp;
wp = NULL;
! while (isascii((int) *cp) && isalpha((int) *cp))
++cp;
if (cp - abbrp == 0)
wp = _("lacks alphabetic at start");
***************
*** 215,221 ****
wp = _("has more than 6 alphabetics");
if (wp == NULL && (*cp == '+' || *cp == '-')) {
++cp;
! if (isascii(*cp) && isdigit(*cp))
if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
++cp;
}
--- 219,225 ----
wp = _("has more than 6 alphabetics");
if (wp == NULL && (*cp == '+' || *cp == '-')) {
++cp;
! if (isascii((int) *cp) && isdigit((int) *cp))
if (*cp++ == '1' && *cp >= '0' && *cp <= '4')
++cp;
}
***************
*** 509,515 ****
}
/*
! ** Thanks to Paul Eggert (eggert at twinsun.com) for logic used in delta.
*/
static long
--- 513,519 ----
}
/*
! ** Thanks to Paul Eggert for logic used in delta.
*/
static long
------- systemv -------
*** /tmp/geta119 Tue Nov 29 11:22:22 2005
--- /tmp/getb119 Tue Nov 29 11:22:22 2005
***************
*** 1,4 ****
! # @(#)systemv 7.3
# Old rules, should the need arise.
# No attempt is made to handle Newfoundland, since it cannot be expressed
--- 1,4 ----
! # @(#)systemv 7.4
# Old rules, should the need arise.
# No attempt is made to handle Newfoundland, since it cannot be expressed
***************
*** 7,24 ****
# the change in the DST rules in the US in 1987 (which occurred before
# the old rules were written).
#
! # If you need the old rules, uncomment ## lines and comment-out Link lines.
# Compile this *without* leap second correction for true conformance.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
! ## Rule SystemV min 1973 - Apr lastSun 2:00 1:00 D
! ## Rule SystemV min 1973 - Oct lastSun 2:00 0 S
! ## Rule SystemV 1974 only - Jan 6 2:00 1:00 D
! ## Rule SystemV 1974 only - Nov lastSun 2:00 0 S
! ## Rule SystemV 1975 only - Feb 23 2:00 1:00 D
! ## Rule SystemV 1975 only - Oct lastSun 2:00 0 S
! ## Rule SystemV 1976 max - Apr lastSun 2:00 1:00 D
! ## Rule SystemV 1976 max - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
## Zone SystemV/AST4ADT -4:00 SystemV A%sT
--- 7,24 ----
# the change in the DST rules in the US in 1987 (which occurred before
# the old rules were written).
#
! # If you need the old rules, uncomment ## lines.
# Compile this *without* leap second correction for true conformance.
# Rule NAME FROM TO TYPE IN ON AT SAVE LETTER/S
! Rule SystemV min 1973 - Apr lastSun 2:00 1:00 D
! Rule SystemV min 1973 - Oct lastSun 2:00 0 S
! Rule SystemV 1974 only - Jan 6 2:00 1:00 D
! Rule SystemV 1974 only - Nov lastSun 2:00 0 S
! Rule SystemV 1975 only - Feb 23 2:00 1:00 D
! Rule SystemV 1975 only - Oct lastSun 2:00 0 S
! Rule SystemV 1976 max - Apr lastSun 2:00 1:00 D
! Rule SystemV 1976 max - Oct lastSun 2:00 0 S
# Zone NAME GMTOFF RULES/SAVE FORMAT [UNTIL]
## Zone SystemV/AST4ADT -4:00 SystemV A%sT
***************
*** 34,50 ****
## Zone SystemV/PST8 -8:00 - PST
## Zone SystemV/YST9 -9:00 - YST
## Zone SystemV/HST10 -10:00 - HST
- # For now...
- Link America/Halifax SystemV/AST4ADT
- Link America/New_York SystemV/EST5EDT
- Link America/Chicago SystemV/CST6CDT
- Link America/Denver SystemV/MST7MDT
- Link America/Los_Angeles SystemV/PST8PDT
- Link America/Anchorage SystemV/YST9YDT
- Link America/Puerto_Rico SystemV/AST4
- Link America/Indianapolis SystemV/EST5
- Link America/Regina SystemV/CST6
- Link America/Phoenix SystemV/MST7
- Link Pacific/Pitcairn SystemV/PST8
- Link Pacific/Gambier SystemV/YST9
- Link Pacific/Honolulu SystemV/HST10
--- 34,36 ----
More information about the tz
mailing list