** This file is in the public domain, so clarified as of
** 1996-06-05 by Arthur David Olson.
**
-** @(#)localtime.c 8.13
+** @(#)localtime.c 8.15
** $FreeBSD: src/lib/libc/stdtime/localtime.c,v 1.25.2.2 2002/08/13 16:08:07 bmilekic Exp $
*/
daylight = 0;
timezone = 0;
- for (i = 0; i < sp->typecnt; ++i) {
- const struct ttinfo * const ttisp = &sp->ttis[i];
-
- tzname[ttisp->tt_isdst] =
- &sp->chars[ttisp->tt_abbrind];
- if (ttisp->tt_isdst)
- daylight = 1;
- if (i == 0 || !ttisp->tt_isdst)
- timezone = -(ttisp->tt_gmtoff);
- }
/*
** And to get the latest zone names into tzname. . .
*/
tzname[ttisp->tt_isdst] =
&sp->chars[ttisp->tt_abbrind];
+ if (ttisp->tt_isdst)
+ daylight = 1;
+ if (!ttisp->tt_isdst)
+ timezone = -(ttisp->tt_gmtoff);
}
/*
** Finally, scrub the abbreviations.
size_t dstlen;
long stdoffset;
long dstoffset;
- time_t * atp;
- unsigned char * typep;
- char * cp;
- int load_result;
+ time_t * atp;
+ unsigned char * typep;
+ char * cp;
+ int load_result;
+ static struct ttinfo zttinfo;
INITIALIZE(dstname);
stdname = name;
/*
** Two transitions per year, from EPOCH_YEAR forward.
*/
+ sp->ttis[0] = sp->ttis[1] = zttinfo;
sp->ttis[0].tt_gmtoff = -dstoffset;
sp->ttis[0].tt_isdst = 1;
sp->ttis[0].tt_abbrind = stdlen + 1;
}
/*
** Finally, fill in ttis.
- ** ttisstd and ttisgmt need not be handled.
*/
+ sp->ttis[0] = sp->ttis[1] = zttinfo;
sp->ttis[0].tt_gmtoff = -stdoffset;
sp->ttis[0].tt_isdst = FALSE;
sp->ttis[0].tt_abbrind = 0;
dstlen = 0;
sp->typecnt = 1; /* only standard time */
sp->timecnt = 0;
+ sp->ttis[0] = zttinfo;
sp->ttis[0].tt_gmtoff = -stdoffset;
sp->ttis[0].tt_isdst = 0;
sp->ttis[0].tt_abbrind = 0;
buildkernel1 buildkernel2:
cd ${.CURDIR}/..; \
- first=; \
for kernconf in ${KERNCONF}; do \
${WORLD_CCVER:C/^..*$/WORLD_CCVER=/}${WORLD_CCVER} \
make -j ${MAKE_JOBS} ${.TARGET:C/build(.*)2/quick\1/:C/1//} \
- KERNCONF=$${kernconf} \
- first=done; \
+ KERNCONF=$${kernconf}; \
done
# note that we do not want to mess with any /usr/obj directories not related
make -m ${.CURDIR}/../share/mk DESTDIR=${ISOROOT} distribution )
cpdup ${ISOROOT}/etc ${ISOROOT}/etc.hdd
cd ${.CURDIR}/..; \
- first=; \
for kernconf in ${KERNCONF}; do \
make DESTDIR=${ISOROOT} installkernel \
KERNCONF=$${kernconf} \
INSTALLSTRIPPEDMODULES=y; \
ln -s kernel ${ISOROOT}/boot/kernel.$${kernconf}/kernel.BOOTP; \
rm -rf ${ISOROOT}/boot/kernel.$${kernconf}.old; \
- first=done; \
done
+.if ${MACHINE_ARCH} == "i386"
+ mv ${ISOROOT}/boot/kernel.GENERIC ${ISOROOT}/boot/kernel.UP
+ mv ${ISOROOT}/boot/kernel.GENERIC_SMP ${ISOROOT}/boot/kernel.SMP
+.else
+ mv ${ISOROOT}/boot/kernel.X86_64_GENERIC ${ISOROOT}/boot/kernel.UP
+ mv ${ISOROOT}/boot/kernel.X86_64_GENERIC_SMP ${ISOROOT}/boot/kernel.SMP
+.endif
mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.local.dist -p ${ISOROOT}/usr/local/
mtree -deU -f ${.CURDIR}/../etc/mtree/BSD.var.dist -p ${ISOROOT}/var
dev_mkdb -f ${ISOROOT}/var/run/dev.db ${ISOROOT}/dev
${CHROOT_CMD} "cd /usr/pkgsrc/bootstrap; \
export share_dir=/usr/pkgobj/bootstrap/work/share; \
./bootstrap --workdir /usr/pkgobj/bootstrap/work"
-.if make(gui)
test -e ${ISODIR}/.didbootstrap || \
echo ".ifdef BSD_PKG_MK # added by nrelease" \
>> ${ISOROOT}/usr/pkg/etc/mk.conf
test -e ${ISODIR}/.didbootstrap || \
+ echo "PKG_DEFAULT_OPTIONS='dri inet6'" \
+ >> ${ISOROOT}/usr/pkg/etc/mk.conf
+.if make(gui)
+ test -e ${ISODIR}/.didbootstrap || \
echo "ACCEPTABLE_LICENSES+=openmotif-license" \
>> ${ISOROOT}/usr/pkg/etc/mk.conf
test -e ${ISODIR}/.didbootstrap || \
echo "ACCEPTABLE_LICENSES+=vim-license" \
>> ${ISOROOT}/usr/pkg/etc/mk.conf
+.endif
test -e ${ISODIR}/.didbootstrap || \
echo ".endif # added by nrelease" \
>> ${ISOROOT}/usr/pkg/etc/mk.conf
-.endif
test -e ${ISODIR}/.didbootstrap || sync
test -e ${ISODIR}/.didbootstrap || touch ${ISODIR}/.didbootstrap
#
NEWFS_MSDOS=sbin/newfs_msdos
NFSD=sbin/nfsd
ROUTE=sbin/route
+SYSCTL=sbin/sysctl
SWAPOFF=sbin/swapoff
SWAPON=sbin/swapon
UMOUNT=sbin/umount
AWK=usr/bin/awk
BUNZIP2=usr/bin/bunzip2
CHFLAGS=usr/bin/chflags
+DIRNAME=usr/bin/dirname
GREP=usr/bin/grep
KILLALL=usr/bin/killall
SED=usr/bin/sed
# $FreeBSD: src/share/zoneinfo/Makefile,v 1.16.2.3 2002/08/07 16:31:52 ru Exp $
-# $DragonFly: src/share/zoneinfo/Makefile,v 1.3 2008/03/02 14:28:37 swildner Exp $
CLEANFILES+= yearistype
.endif
TZFILES= africa antarctica asia australasia etcetera europe \
- factory northamerica southamerica systemv
+ northamerica southamerica systemv
POSIXRULES= America/New_York
.if defined(OLDTIMEZONES)
-@(#)Theory 8.4
+@(#)Theory 8.5
This file is in the public domain, so clarified as of
2009-05-17 by Arthur David Olson.
See the file `backward' for most of these older names
(e.g. `US/Eastern' instead of `America/New_York').
The other old-fashioned names still supported are
-`WET', `CET', `MET', `EET' (see the file `europe'),
-and `Factory' (see the file `factory').
+`WET', `CET', `MET', and `EET' (see the file `europe').
----- Time zone abbreviations -----
-# @(#)asia 8.61
+# @(#)asia 8.62
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
Rule HK 1954 1964 - Mar Sun>=18 3:30 1:00 S
Rule HK 1954 only - Oct 31 3:30 0 -
Rule HK 1955 1964 - Nov Sun>=1 3:30 0 -
-Rule HK 1965 1977 - Apr Sun>=16 3:30 1:00 S
-Rule HK 1965 1977 - Oct Sun>=16 3:30 0 -
+Rule HK 1965 1976 - Apr Sun>=16 3:30 1:00 S
+Rule HK 1965 1976 - Oct Sun>=16 3:30 0 -
Rule HK 1973 only - Dec 30 3:30 1:00 S
Rule HK 1979 only - May Sun>=8 3:30 1:00 S
Rule HK 1979 only - Oct Sun>=16 3:30 0 -
# <pre>
-# @(#)australasia 8.18
+# @(#)australasia 8.19
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
# http://www.parliament.gov.ws/documents/acts/Daylight%20Saving%20Act%20%202009%20%28English%29%20-%20Final%207-7-091.pdf
# </a>
+# From Raymond Hughes (2010-10-07):
+# Please see
+# <a href="http://www.mcil.gov.ws">
+# http://www.mcil.gov.ws
+# </a>,
+# the Ministry of Commerce, Industry and Labour (sideframe) "Last Sunday
+# September 2010 (26/09/10) - adjust clocks forward from 12:00 midnight
+# to 01:00am and First Sunday April 2011 (03/04/11) - adjust clocks
+# backwards from 1:00am to 12:00am"
+
Zone Pacific/Apia 12:33:04 - LMT 1879 Jul 5
-11:26:56 - LMT 1911
-11:30 - SAMT 1950 # Samoa Time
-11:00 - WST 2010 Sep 26
- -11:00 1:00 WSDT 2011 Apr 3
+ -11:00 1:00 WSDT 2011 Apr 3 1:00
-11:00 - WST
# Solomon Is
+++ /dev/null
-# <pre>
-# @(#)factory 8.2
-# This file is in the public domain, so clarified as of
-# 2009-05-17 by Arthur David Olson.
-
-# For companies who don't want to put time zone specification in
-# their installation procedures. When users run date, they'll get the message.
-# Also useful for the "comp.sources" version.
-
-# Zone NAME GMTOFF RULES FORMAT
-Zone Factory 0 - "Local time zone must be set--see zic manual page"
# <pre>
-# @(#)zone.tab 8.37
+# @(#)zone.tab 8.38
# This file is in the public domain, so clarified as of
# 2009-05-17 by Arthur David Olson.
#
AQ -6736+06253 Antarctica/Mawson Mawson Station, Holme Bay
AQ -6835+07758 Antarctica/Davis Davis Station, Vestfold Hills
AQ -6617+11031 Antarctica/Casey Casey Station, Bailey Peninsula
-AQ -7824+10654 Antarctica/Vostok Vostok Station, S Magnetic Pole
+AQ -7824+10654 Antarctica/Vostok Vostok Station, Lake Vostok
AQ -6640+14001 Antarctica/DumontDUrville Dumont-d'Urville Station, Terre Adelie
AQ -690022+0393524 Antarctica/Syowa Syowa Station, E Ongul I
AQ -5430+15857 Antarctica/Macquarie Macquarie Island Station, Macquarie Island
sprintf(command_errbuf, "if stack too deep");
return(-1);
} else if (argc != 2) {
- sprintf(command_errbuf, "ifexists requires one argument");
+ sprintf(command_errbuf, "ifset requires one argument");
return(-1);
} else {
struct cond *cond = &CondStack[CondIndex++];
sprintf(command_errbuf, "elseifexists without if");
return(-1);
} else if (argc != 2) {
- sprintf(command_errbuf, "ifexists requires one argument");
+ sprintf(command_errbuf, "elseifexists requires one argument");
return(-1);
} else {
struct stat sb;
# Default boot /boot/kernel/ is the user-installed kernel and
# is always checked first. Otherwise fallback to generic kernels.
#
-unset present64
ifset default_kernel
# already selected a kernel
elseifexists kernel
set default_kernel=kernel
- set present64=1
-elseifexists kernel.GENERIC
- set default_kernel=kernel.GENERIC
- set present64=1
-elseifexists kernel.GENERIC_SMP
- set default_kernel=kernel.GENERIC_SMP
- set present64=1
-elseifexists kernel.X86_64_GENERIC
- set default_kernel=kernel.X86_64_GENERIC
-elseifexists kernel.X86_64_GENERIC_SMP
- set default_kernel=kernel.X86_64_GENERIC_SMP
+elseifexists kernel.UP
+ set default_kernel=kernel.UP
+elseifexists kernel.SMP
+ set default_kernel=kernel.SMP
else
set default_kernel=kernel
endif
menuadd boot
menuadd set autoboot_delay=NO
-ifexists ${default_kernel}_SMP
+ifexists kernel.SMP
menuitem m "Select SMP kernel"
-menuadd set default_kernel=${default_kernel}_SMP
+menuadd set default_kernel=kernel.SMP
menuadd include ${base}defaults/dloader.menu
menuadd optinclude ${base}dloader.menu
menuadd menu
endif
-ifset present64
-ifexists ${base}kernel.X86_64_GENERIC
-menuitem x "Select 64-bit UP kernel"
-menuadd set default_kernel=kernel.X86_64_GENERIC
-menuadd include ${base}defaults/dloader.menu
-menuadd optinclude ${base}dloader.menu
-menuadd menu
-endif
-endif
-
-ifset present64
-ifexists ${base}kernel.X86_64_GENERIC_SMP
-menuitem y "Select 64-bit SMP kernel"
-menuadd set default_kernel=kernel.X86_64_GENERIC_SMP
-menuadd include ${base}defaults/dloader.menu
-menuadd optinclude ${base}dloader.menu
-menuadd menu
-endif
-endif
-
menuitem R "Reboot"
menuadd reboot
-
-unset present64
switch (dfui_be_present_dialog(a->c, _("Local or UTC (Greenwich Mean Time) clock"),
_("Yes|No"),
- _("Is this machine's CMOS clock set to UTC?\n"),
- _("If it is set to local time, or you don't know, please choose NO here!"))) {
+ _("Is this machine's CMOS clock set to UTC?\n\n"
+ "If it is set to local time, or you don't know, please choose NO here!"))) {
case 1:
cmds = commands_new();
command_add(cmds, "%s%s %s%setc/wall_cmos_clock",
a->os_root, cmd_name(a, "MOUNT"),
a->os_root,
subpartition_get_device_name(a_subpart),
- a->os_root, a->cfg_root);
+ a->os_root);
command_add(cmds,
"%s%s %sdev/`%s%s \"^vfs\\.root\\.mountfrom\" %sboot/loader.conf |"
"%s%s -Fhammer: '{print $2;}' |"
a->os_root, a->cfg_root);
command_add(cmds, "%s%s %sboot",
a->os_root, cmd_name(a, "UMOUNT"),
- a->os_root, a->cfg_root);
+ a->os_root);
}
if (!commands_execute(a, cmds)) {
commands_free(cmds);
"then try installing the bootblock again. "
"Note that this should not affect the "
"partition table of the disk."),
- disk, disk)) {
+ disk)) {
case 1:
cmds = commands_new();
command_add(cmds,
command_add(cmds, "%s%s 600 %smnt/var/log/install.log",
a->os_root, cmd_name(a, "CHMOD"), a->os_root);
+ /*
+ * Move the kernel used for booting (kernel.UP or kernel.SMP) to
+ * /boot/kernel and remove the other kernel
+ */
+ command_add(cmds,
+ "%s%s %smnt`%s%s $(%s%s -n kern.bootfile)` %smnt/boot/kernel",
+ a->os_root, cmd_name(a, "MV"),
+ a->os_root,
+ a->os_root, cmd_name(a, "DIRNAME"),
+ a->os_root, cmd_name(a, "SYSCTL"),
+ a->os_root);
+ command_add(cmds,
+ "%s%s -R noschg %smnt/boot/kernel.[SU]M*P; %s%s -rf %smnt/boot/kernel.[SU]M*P",
+ a->os_root, cmd_name(a, "CHFLAGS"),
+ a->os_root,
+ a->os_root, cmd_name(a, "RM"),
+ a->os_root);
+
/* Customize stuff here */
- if(is_file("%susr/local/bin/after_installation_routines.sh")) {
+ if(is_file("%susr/local/bin/after_installation_routines.sh", a->os_root)) {
command_add(cmds, "%susr/local/bin/after_installation_routines.sh",
- a->os_root, _("Running after installation custom routines..."));
+ a->os_root);
}
/*
if (total_capacity > slice_get_capacity(storage_get_selected_slice(a->s))) {
inform(a->c, _("The space allocated to all of your selected "
- "subpartitions (%dM) exceeds the total "
+ "subpartitions (%luM) exceeds the total "
"capacity of the selected primary partition "
- "(%dM). Remove some subpartitions or choose "
+ "(%luM). Remove some subpartitions or choose "
"a smaller size for them and try again."),
total_capacity, slice_get_capacity(storage_get_selected_slice(a->s)));
return(0);
if (total_capacity > slice_get_capacity(storage_get_selected_slice(a->s))) {
inform(a->c, _("The space allocated to all of your selected "
- "subpartitions (%dM) exceeds the total "
+ "subpartitions (%luM) exceeds the total "
"capacity of the selected primary partition "
- "(%dM). Remove some subpartitions or choose "
+ "(%luM). Remove some subpartitions or choose "
"a smaller size for them and try again."),
total_capacity, slice_get_capacity(storage_get_selected_slice(a->s)));
return(0);
void aura_buffer_cpy(struct aura_buffer *, const char *);
void aura_buffer_cat(struct aura_buffer *, const char *);
-int aura_buffer_cat_file(struct aura_buffer *, const char *, ...);
-int aura_buffer_cat_pipe(struct aura_buffer *, const char *, ...);
+int aura_buffer_cat_file(struct aura_buffer *, const char *, ...)
+ __printflike(2, 3);
+int aura_buffer_cat_pipe(struct aura_buffer *, const char *, ...)
+ __printflike(2, 3);
int aura_buffer_seek(struct aura_buffer *, size_t);
size_t aura_buffer_tell(struct aura_buffer *);
/*** PROTOTYPES ***/
-int is_dir(const char *, ...);
-int is_file(const char *, ...);
-int is_program(const char *, ...);
-int is_device(const char *, ...);
-int is_named_pipe(const char *, ...);
+int is_dir(const char *, ...) __printflike(1, 2);
+int is_file(const char *, ...) __printflike(1, 2);
+int is_program(const char *, ...) __printflike(1, 2);
+int is_device(const char *, ...) __printflike(1, 2);
+int is_named_pipe(const char *, ...) __printflike(1, 2);
int is_mountpoint_mounted(const char *);
int is_device_mounted(const char *);
int is_any_slice_mounted(const char *);
#define AURA_PGETS_EOF 3
#define AURA_PGETS_FGETS_ERR 4
-FILE *aura_popen(const char *, const char *, ...);
+FILE *aura_popen(const char *, const char *, ...)
+ __printflike(1, 3);
int aura_pclose(FILE *);
pid_t aura_pgetpid(FILE *);
int aura_pgets(FILE *, char *, size_t, long, int *);
*/
int dfui_be_present_dialog(struct dfui_connection *,
- const char *, const char *, const char *, ...);
+ const char *, const char *, const char *, ...)
+ __printflike(4, 5);
/*
* BACKEND HIGH LEVEL INTERFACE
#define langcount (sizeof(langset) / sizeof(struct _langset))
static int get_lang_num(const char *langname);
-static int system_fmt(const char *fmt, ...);
+static int system_fmt(const char *fmt, ...) __printflike(1, 2);
static int
/*** PROTOTYPES ***/
struct commands *commands_new(void);
-struct command *command_add(struct commands *, const char *, ...);
+struct command *command_add(struct commands *, const char *, ...)
+ __printflike(2, 3);
void command_set_log_mode(struct command *, int);
void command_set_failure_mode(struct command *, int);
-void command_set_desc(struct command *, const char *, ...);
-void command_set_tag(struct command *, const char *, ...);
+void command_set_desc(struct command *, const char *, ...)
+ __printflike(2, 3);
+void command_set_tag(struct command *, const char *, ...)
+ __printflike(2, 3);
struct command *command_get_first(const struct commands *);
struct command *command_get_next(const struct command *);
/* Command Generators */
void unmount_all_under(struct i_fn_args *, struct commands *,
- const char *, ...);
+ const char *, ...) __printflike(3, 4);
#endif /* !__COMMANDS_H_ */
int config_var_set(struct config_vars *, const char *, const char *);
const char *config_var_get(const struct config_vars *, const char *);
int config_vars_write(const struct config_vars *, int,
- const char *, ...);
+ const char *, ...) __printflike(3, 4);
int config_vars_read(struct i_fn_args *,
- struct config_vars *, int,
- const char *, ...);
+ struct config_vars *, int, const char *, ...)
+ __printflike(4, 5);
#endif /* !__CONFED_H_ */
int, long, long, int);
struct subpartition *subpartition_new_hammer(struct slice *, const char *, long);
int subpartition_count(const struct slice *);
-struct subpartition *subpartition_find(const struct slice *, const char *, ...);
-struct subpartition *subpartition_of(const struct slice *, const char *, ...);
+struct subpartition *subpartition_find(const struct slice *, const char *, ...)
+ __printflike(2, 3);
+struct subpartition *subpartition_of(const struct slice *, const char *, ...)
+ __printflike(2, 3);
struct subpartition *subpartition_find_capacity(const struct slice *, long);
void subpartitions_free(struct slice *);
struct subpartition *subpartition_next(const struct subpartition *);
struct i_fn_args *i_fn_args_new(const char *, const char *, int, const char *);
void i_fn_args_free(struct i_fn_args *);
-void i_log(struct i_fn_args *, const char *, ...);
+void i_log(struct i_fn_args *, const char *, ...)
+ __printflike(2, 3);
/* General Utilities */
#ifndef __UIUTIL_H_
#define __UIUTIL_H_
-void inform(struct dfui_connection *, const char *, ...);
-int confirm_dangerous_action(struct dfui_connection *, const char *, ...);
+void inform(struct dfui_connection *, const char *, ...)
+ __printflike(2, 3);
+int confirm_dangerous_action(struct dfui_connection *, const char *, ...)
+ __printflike(2, 3);
#endif /* !__UIUTIL_H_ */
** This file is in the public domain, so clarified as of
** 2006-07-17 by Arthur David Olson.
**
-** @(#)zic.c 8.20
+** @(#)zic.c 8.24
** $FreeBSD: src/usr.sbin/zic/zic.c,v 1.11 1999/08/28 01:21:20 peter Exp $
-** $DragonFly: src/usr.sbin/zic/zic.c,v 1.7 2008/10/19 20:15:58 swildner Exp $
*/
#include <err.h>
if (thistimei == 0)
writetype[0] = TRUE;
}
+ /*
+ ** 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).
+ */
+ {
+ 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;
+ }
+ }
thistypecnt = 0;
for (i = 0; i < typecnt; ++i)
typemap[i] = writetype[i] ? thistypecnt++ : -1;
int week;
if (rp->r_dycode == DC_DOWGEQ) {
- week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
- if ((week - 1) * DAYSPERWEEK + 1 != rp->r_dayofmonth)
+ if ((rp->r_dayofmonth % DAYSPERWEEK) != 1)
return -1;
+ week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
} else if (rp->r_dycode == DC_DOWLEQ) {
if (rp->r_dayofmonth == len_months[1][rp->r_month])
week = 5;
else {
- week = 1 + rp->r_dayofmonth / DAYSPERWEEK;
- if (week * DAYSPERWEEK - 1 != rp->r_dayofmonth)
+ if ((rp->r_dayofmonth % DAYSPERWEEK) != 0)
return -1;
+ week = rp->r_dayofmonth / DAYSPERWEEK;
}
} else return -1; /* "cannot happen" */
sprintf(result, "M%d.%d.%d",
char *envvar;
int max_abbr_len;
int max_envvar_len;
+ int prodstic; /* all rules are min to max */
max_abbr_len = 2 + max_format_len + max_abbrvar_len;
max_envvar_len = 2 * max_abbr_len + 5 * 9;
timecnt = 0;
typecnt = 0;
charcnt = 0;
+ prodstic = zonecount == 1;
/*
** Thanks to Earl Chew
** for noting the need to unconditionally initialize startttisstd.
updateminmax(rp->r_loyear);
if (rp->r_hiwasnum)
updateminmax(rp->r_hiyear);
+ if (rp->r_lowasnum || rp->r_hiwasnum)
+ prodstic = FALSE;
}
}
/*
if (max_year <= INT_MAX - YEARSPERREPEAT)
max_year += YEARSPERREPEAT;
else max_year = INT_MAX;
+ /*
+ ** Regardless of any of the above,
+ ** for a "proDSTic" zone which specifies that its rules
+ ** always have and always will be in effect,
+ ** we only need one cycle to define the zone.
+ */
+ if (prodstic) {
+ min_year = 1900;
+ max_year = min_year + YEARSPERREPEAT;
+ }
}
/*
** For the benefit of older systems,