OpenBSD CVS

CVS log for src/usr.bin/calendar/day.c


[BACK] Up to [local] / src / usr.bin / calendar

Request diff between arbitrary revisions


Default branch: MAIN


Revision 1.37 / (download) - annotate - [select for diffs], Mon Aug 12 20:03:28 2019 UTC (4 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_7_5_BASE, OPENBSD_7_5, OPENBSD_7_4_BASE, OPENBSD_7_4, OPENBSD_7_3_BASE, OPENBSD_7_3, OPENBSD_7_2_BASE, OPENBSD_7_2, OPENBSD_7_1_BASE, OPENBSD_7_1, OPENBSD_7_0_BASE, OPENBSD_7_0, OPENBSD_6_9_BASE, OPENBSD_6_9, OPENBSD_6_8_BASE, OPENBSD_6_8, OPENBSD_6_7_BASE, OPENBSD_6_7, OPENBSD_6_6_BASE, OPENBSD_6_6, HEAD
Changes since 1.36: +9 -5 lines
Diff to previous 1.36 (colored)

In isnow(), always validate the value of the month variable before
using it as an index into the cumdays[] array.
Found with American Fuzzy Lop.  Original diff by and OK fcambus@

Revision 1.36 / (download) - annotate - [select for diffs], Fri Feb 1 16:22:53 2019 UTC (5 years, 3 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_5_BASE, OPENBSD_6_5
Changes since 1.35: +2 -2 lines
Diff to previous 1.35 (colored)

Fix regresion that prevented -A0 from working as before.
This can be used to disable the default behavior of reporting events
for the weekend on a Friday.

Revision 1.35 / (download) - annotate - [select for diffs], Tue Jan 29 20:08:56 2019 UTC (5 years, 3 months ago) by millert
Branch: MAIN
Changes since 1.34: +2 -2 lines
Diff to previous 1.34 (colored)

Fix a bug with -flag where later events may be shown when they should not be.
The problem is caused by the special handling of Friday, where calendar will
show the upcoming events for the weeked as well.  This change disables the
special handling of Friday for the -B option, as was already done for -A.
From Andy Bradford.

Revision 1.34 / (download) - annotate - [select for diffs], Wed Sep 14 15:09:46 2016 UTC (7 years, 7 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_4_BASE, OPENBSD_6_4, OPENBSD_6_3_BASE, OPENBSD_6_3, OPENBSD_6_2_BASE, OPENBSD_6_2, OPENBSD_6_1_BASE, OPENBSD_6_1
Changes since 1.33: +4 -2 lines
Diff to previous 1.33 (colored)

Fix bug introduced in the fix for days outside the target month.
From Andy Bradford

Revision 1.33 / (download) - annotate - [select for diffs], Wed Jul 13 21:32:01 2016 UTC (7 years, 9 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_6_0_BASE, OPENBSD_6_0
Changes since 1.32: +4 -3 lines
Diff to previous 1.32 (colored)

When matching a day in the month, make sure that the date is still
in the month we are interested in after calling mktime(3).  This
fixes things like Sunday+5 for months where there is not a 5th
Sunday and the 31st day in months with less than 31 days.
From Andy Bradford

Revision 1.32 / (download) - annotate - [select for diffs], Tue Dec 8 19:04:50 2015 UTC (8 years, 4 months ago) by mmcc
Branch: MAIN
CVS Tags: OPENBSD_5_9_BASE, OPENBSD_5_9
Changes since 1.31: +5 -9 lines
Diff to previous 1.31 (colored)

Remove NULL-checks before free(). ok tb@

Revision 1.31 / (download) - annotate - [select for diffs], Mon Dec 7 18:46:35 2015 UTC (8 years, 4 months ago) by espie
Branch: MAIN
Changes since 1.30: +11 -12 lines
Diff to previous 1.30 (colored)

tweak the code a bit and add a -w option to display day of week.
okay jmc@, millert@

Revision 1.30 / (download) - annotate - [select for diffs], Fri Oct 23 11:43:16 2015 UTC (8 years, 6 months ago) by zhuk
Branch: MAIN
Changes since 1.29: +2 -2 lines
Diff to previous 1.29 (colored)

A bit of whitespace cleanup, to make further diffs smaller.

Revision 1.29 / (download) - annotate - [select for diffs], Tue Mar 17 19:31:30 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_5_8_BASE, OPENBSD_5_8
Changes since 1.28: +11 -14 lines
Diff to previous 1.28 (colored)

Eliminate use of TM_YEAR_BASE.  OK guenther@ deraadt@ miod@

Revision 1.28 / (download) - annotate - [select for diffs], Sun Mar 15 00:41:28 2015 UTC (9 years, 1 month ago) by millert
Branch: MAIN
Changes since 1.27: +1 -2 lines
Diff to previous 1.27 (colored)

tzfile.h is an internal header that should never have been installed.
What's worse, the tzfile.h that gets installed is over 20 years old
and doesn't match the real tzfile.h in libc/time.  This makes the
tree safe for /usr/include/tzfile.h removal.  The TM_YEAR_BASE
define has been moved to time.h temporarily until its usage is
replaced by 1900 in the tree.  Actual removal of tzfile.h is pending
a ports build.  Based on a diff from deraadt@

Revision 1.27 / (download) - annotate - [select for diffs], Tue Nov 26 13:18:53 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_7_BASE, OPENBSD_5_7, OPENBSD_5_6_BASE, OPENBSD_5_6, OPENBSD_5_5_BASE, OPENBSD_5_5
Changes since 1.26: +5 -5 lines
Diff to previous 1.26 (colored)

unsigned char casts for ctype
ok krw

Revision 1.26 / (download) - annotate - [select for diffs], Tue Nov 12 19:35:47 2013 UTC (10 years, 5 months ago) by deraadt
Branch: MAIN
Changes since 1.25: +2 -3 lines
Diff to previous 1.25 (colored)

deal with lack of prototype

Revision 1.25 / (download) - annotate - [select for diffs], Tue Apr 16 18:28:24 2013 UTC (11 years ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_5_4_BASE, OPENBSD_5_4
Changes since 1.24: +2 -1 lines
Diff to previous 1.24 (colored)

bzero struct tm before use; ok millert

Revision 1.24 / (download) - annotate - [select for diffs], Tue Apr 2 04:40:21 2013 UTC (11 years, 1 month ago) by deraadt
Branch: MAIN
Changes since 1.23: +2 -2 lines
Diff to previous 1.23 (colored)

handle large time_t in DEBUG code

Revision 1.23 / (download) - annotate - [select for diffs], Wed Apr 28 18:20:15 2010 UTC (14 years ago) by jsg
Branch: MAIN
CVS Tags: OPENBSD_5_3_BASE, OPENBSD_5_3, OPENBSD_5_2_BASE, OPENBSD_5_2, OPENBSD_5_1_BASE, OPENBSD_5_1, OPENBSD_5_0_BASE, OPENBSD_5_0, OPENBSD_4_9_BASE, OPENBSD_4_9, OPENBSD_4_8_BASE, OPENBSD_4_8
Changes since 1.22: +3 -1 lines
Diff to previous 1.22 (colored)

shuffle extern decl of header[] so gcc4 doesn't complain about
incomplete types.

ok deraadt@ 'Looks acceptable' miod@

Revision 1.22 / (download) - annotate - [select for diffs], Tue Oct 27 23:59:36 2009 UTC (14 years, 6 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_7_BASE, OPENBSD_4_7
Changes since 1.21: +1 -15 lines
Diff to previous 1.21 (colored)

rcsid[] and sccsid[] and copyright[] are essentially unmaintained (and
unmaintainable).  these days, people use source.  these id's do not provide
any benefit, and do hurt the small install media
(the 33,000 line diff is essentially mechanical)
ok with the idea millert, ok dms

Revision 1.21 / (download) - annotate - [select for diffs], Sun Apr 13 00:22:17 2008 UTC (16 years ago) by djm
Branch: MAIN
CVS Tags: OPENBSD_4_6_BASE, OPENBSD_4_6, OPENBSD_4_5_BASE, OPENBSD_4_5, OPENBSD_4_4_BASE, OPENBSD_4_4
Changes since 1.20: +3 -3 lines
Diff to previous 1.20 (colored)

Use arc4random_buf() when requesting more than a single word of output

Use arc4random_uniform() when the desired random number upper bound
is not a power of two

ok deraadt@ millert@

Revision 1.20 / (download) - annotate - [select for diffs], Wed Nov 16 16:45:11 2005 UTC (18 years, 5 months ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_4_3_BASE, OPENBSD_4_3, OPENBSD_4_2_BASE, OPENBSD_4_2, OPENBSD_4_1_BASE, OPENBSD_4_1, OPENBSD_4_0_BASE, OPENBSD_4_0, OPENBSD_3_9_BASE, OPENBSD_3_9
Changes since 1.19: +54 -61 lines
Diff to previous 1.19 (colored)

knf & cleanup; mickey ok

Revision 1.19 / (download) - annotate - [select for diffs], Tue Aug 9 12:32:58 2005 UTC (18 years, 8 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_8_BASE, OPENBSD_3_8
Changes since 1.18: +3 -3 lines
Diff to previous 1.18 (colored)

handle -A0 correctly; from koen@egelink.nl

Revision 1.18 / (download) - annotate - [select for diffs], Fri Dec 10 20:47:30 2004 UTC (19 years, 4 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_7_BASE, OPENBSD_3_7
Changes since 1.17: +11 -8 lines
Diff to previous 1.17 (colored)

define pesach (by gauss) and fix judaic calendar

Revision 1.17 / (download) - annotate - [select for diffs], Fri Dec 10 15:31:01 2004 UTC (19 years, 4 months ago) by mickey
Branch: MAIN
Changes since 1.16: +2 -2 lines
Diff to previous 1.16 (colored)

cleanup extra includes and -Wall

Revision 1.16 / (download) - annotate - [select for diffs], Fri Dec 10 15:00:27 2004 UTC (19 years, 4 months ago) by mickey
Branch: MAIN
Changes since 1.15: +39 -10 lines
Diff to previous 1.15 (colored)

allow calendar files in julian

Revision 1.15 / (download) - annotate - [select for diffs], Tue Jun 3 02:56:06 2003 UTC (20 years, 11 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_3_6_BASE, OPENBSD_3_6, OPENBSD_3_5_BASE, OPENBSD_3_5, OPENBSD_3_4_BASE, OPENBSD_3_4
Changes since 1.14: +3 -7 lines
Diff to previous 1.14 (colored)

Remove the advertising clause in the UCB license which Berkeley
rescinded 22 July 1999.  Proofed by myself and Theo.

Revision 1.14 / (download) - annotate - [select for diffs], Mon Nov 19 19:02:13 2001 UTC (22 years, 5 months ago) by mpech
Branch: MAIN
CVS Tags: OPENBSD_3_3_BASE, OPENBSD_3_3, OPENBSD_3_2_BASE, OPENBSD_3_2, OPENBSD_3_1_BASE, OPENBSD_3_1
Changes since 1.13: +8 -8 lines
Diff to previous 1.13 (colored)

kill more registers

millert@ ok

Revision 1.13 / (download) - annotate - [select for diffs], Thu Sep 27 18:19:20 2001 UTC (22 years, 7 months ago) by mickey
Branch: MAIN
CVS Tags: OPENBSD_3_0_BASE, OPENBSD_3_0
Changes since 1.12: +13 -12 lines
Diff to previous 1.12 (colored)

some fixes and cleanups some from dfa@solo.ee, some pointed
out by pjanzen@ .

Revision 1.12 / (download) - annotate - [select for diffs], Wed Sep 26 20:38:55 2001 UTC (22 years, 7 months ago) by mickey
Branch: MAIN
Changes since 1.11: +23 -6 lines
Diff to previous 1.11 (colored)

special procesing for cyrillic calendars (.ru, .ua, .by for now).
does not affect any existing behaviour for everything else.
old idea expressed by form@; millert@ ok

Revision 1.11 / (download) - annotate - [select for diffs], Tue Jun 5 21:27:16 2001 UTC (22 years, 11 months ago) by pjanzen
Branch: MAIN
Changes since 1.10: +9 -9 lines
Diff to previous 1.10 (colored)

errx->err where errno is set

Revision 1.10 / (download) - annotate - [select for diffs], Thu Nov 25 03:46:46 1999 UTC (24 years, 5 months ago) by pjanzen
Branch: MAIN
CVS Tags: OPENBSD_2_9_BASE, OPENBSD_2_9, OPENBSD_2_8_BASE, OPENBSD_2_8, OPENBSD_2_7_BASE, OPENBSD_2_7
Changes since 1.9: +5 -5 lines
Diff to previous 1.9 (colored)

Parse dates only before the first <tab> character; otherwise, weekly events
whose description starts with a valid month are misparsed.

Revision 1.9 / (download) - annotate - [select for diffs], Sun Apr 25 01:16:04 1999 UTC (25 years ago) by pjanzen
Branch: MAIN
CVS Tags: OPENBSD_2_6_BASE, OPENBSD_2_6
Changes since 1.8: +3 -3 lines
Diff to previous 1.8 (colored)

Fixed bug involving offsets from yearly "special events" (i.e Easter).

Revision 1.8 / (download) - annotate - [select for diffs], Thu Mar 4 03:34:35 1999 UTC (25 years, 2 months ago) by pjanzen
Branch: MAIN
CVS Tags: OPENBSD_2_5_BASE, OPENBSD_2_5
Changes since 1.7: +16 -2 lines
Diff to previous 1.7 (colored)

Correctly handle yearly events occurring on fixed weekdays in all cases.

Revision 1.7 / (download) - annotate - [select for diffs], Sun Dec 13 07:31:07 1998 UTC (25 years, 4 months ago) by pjanzen
Branch: MAIN
Changes since 1.6: +284 -98 lines
Diff to previous 1.6 (colored)

Show periodic events the correct number of times.
Calculate special events (Easter) correctly regardless of which year
they occur in (thus fixing user/562).
Keep locales and special event names from propogating from one user
to the next during "calendar -a".
Set up a framework to handle special events other than Easter (for instance,
Jewish events, eventually).
Various other fixes.

Revision 1.6 / (download) - annotate - [select for diffs], Sun Nov 8 04:31:13 1998 UTC (25 years, 6 months ago) by pjanzen
Branch: MAIN
Changes since 1.5: +32 -24 lines
Diff to previous 1.5 (colored)

Sort output by date; include framework for showing periodic events more than
once

Revision 1.5 / (download) - annotate - [select for diffs], Wed Nov 4 11:32:02 1998 UTC (25 years, 6 months ago) by pjanzen
Branch: MAIN
Changes since 1.4: +29 -36 lines
Diff to previous 1.4 (colored)

Various fixes, including closing user/630.

Revision 1.4 / (download) - annotate - [select for diffs], Mon Mar 30 06:59:26 1998 UTC (26 years, 1 month ago) by deraadt
Branch: MAIN
CVS Tags: OPENBSD_2_4_BASE, OPENBSD_2_4, OPENBSD_2_3_BASE, OPENBSD_2_3
Changes since 1.3: +10 -7 lines
Diff to previous 1.3 (colored)

Y2K fixes from Andreas.Gunnarsson@emw.ericsson.se; culled from various places

Revision 1.3 / (download) - annotate - [select for diffs], Mon Feb 23 05:48:42 1998 UTC (26 years, 2 months ago) by millert
Branch: MAIN
Changes since 1.2: +10 -18 lines
Diff to previous 1.2 (colored)

Avoid a few strlen's as strftime(3) returns the len.

Revision 1.2 / (download) - annotate - [select for diffs], Tue Aug 26 23:37:21 1997 UTC (26 years, 8 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_2_BASE, OPENBSD_2_2
Changes since 1.1: +14 -12 lines
Diff to previous 1.1 (colored)

Make -t option use a date string like date(1).

Revision 1.1 / (download) - annotate - [select for diffs], Thu Dec 5 06:04:39 1996 UTC (27 years, 5 months ago) by millert
Branch: MAIN
CVS Tags: OPENBSD_2_1_BASE, OPENBSD_2_1

FreeBSD calendar(1) + OpenBSD changes.

This form allows you to request diff's between any two revisions of a file. You may select a symbolic revision name using the selection box or you may type in a numeric name using the type-in text box.