Commit Graph

21 Commits

Author SHA1 Message Date
Stefan Eßer
a3c29cdbd4 Replace strcat, strcpy and snprintf with bounds checking versions 2020-12-31 12:37:37 +01:00
Stefan Eßer
1462201cd5 Add file names and line numbers to calendar format error messages
Without file name and line number it is very cumbersum to identify the
locations of errors in calendar files.

MFC after:	3 days
2020-10-31 13:32:08 +00:00
Oleksandr Tymoshenko
c01c8cccf5 Fix calculation of the recurring weekdays
Both the result of the first_dayofweek_of_year and the target
weekday are zero-based (0 fo sunday) while the target month-day
or year-day is 1-based. Adjust logic accordingly.

Also add testcase for this PR to the kyua test suite

PR:		201062
Submitted by:	Richard Narron <comet.berkeley@gmail.com>
MFC after:	1 week
2020-04-03 01:17:43 +00:00
Conrad Meyer
fd1efedc79 Add extremely useful calendar(1) application to FreeBSD
It does extremely useful things like execute sendmail and spew dubiously
accurate factoids.

From the feedback, it seems like it is an essential utility in a modern unix
and not at all a useless bikeshed.  How do those Linux people live without it?
Reverts r358561.
2020-03-03 00:20:08 +00:00
Conrad Meyer
3c565de33f Fix typo in r278616
FreeBSD isn't an encyclopedia.
2020-03-02 23:37:47 +00:00
Pedro F. Giffuni
1de7b4b805 various: general adoption of SPDX licensing ID tags.
Mainly focus on files that use BSD 2-Clause license, however the tool I
was using misidentified many licenses so this was mostly a manual - error
prone - task.

The Software Package Data Exchange (SPDX) group provides a specification
to make it easier for automated tools to detect and summarize well known
opensource licenses. We are gradually adopting the specification, noting
that the tags are considered only advisory and do not, in any way,
superceed or replace the license texts.

No functional change intended.
2017-11-27 15:37:16 +00:00
Eitan Adler
463a577b27 Fix a ton of speelling errors
arc lint is helpful

Reviewed By: allanjude, wblock, #manpages, chris@bsdjunk.com
Differential Revision: https://reviews.freebsd.org/D3337
2015-10-21 05:37:09 +00:00
Greg Lehey
90c72ba909 Handle some expression regressions.
Explicitly use GNU cpp for preprocessing.
Remove explicit debugging code.
Change some variable names to be less confusing.
Improve some comments.
Improve indentation.

PR:		162211
		168785
MFC after:	2 weeks
2013-06-12 07:52:49 +00:00
Greg Lehey
34be301210 Use even more conventional conversion routines.
Reported by: peterj@
2012-12-13 02:21:05 +00:00
Greg Lehey
d6a381f8c9 Reluctantly remove one of the most extraordinary numeric conversion
routines I have ever seen and replace with something far more boring.
2012-12-13 01:44:58 +00:00
Greg Lehey
415f031163 Tidy up command line processing:
- Add ? option to optstring.
  - Sort options alphabetically.
  - Vertical space.

Tidy up usage() function.

Bring man page in sync with source.

Ensure that debug code is only executed with the -d option.

Submitted by: Christiane Yeardley
2011-11-09 01:40:46 +00:00
Edwin Groothuis
fcc2fa496d Fix run-time breakage when encoutering invalid input-data.
PR:		bin/157718
2011-07-11 22:01:39 +00:00
Edwin Groothuis
5a5bcf88e4 Fix the interpreter for:
Jul/Sat+3       Every third saturday of July - Jul/Sat+3

which was able to be done via:

Jul/SatThird	Every third saturday of July - Jul/SatThird

Add interpreters for:

SatFourth	Every third saturday of each month - SatFourth
Sat+4           Every third saturday of each month - Sat+4
Sat 		Every saturday of each month - Sat

MFC after:	2 weeks
2011-07-11 08:24:36 +00:00
Sergey A. Osokin
2aa2451972 Fix Paskha and Paskha-specific holidays. 2011-02-09 05:30:38 +00:00
Sergey A. Osokin
f6db469642 Fix typo (Pashka -> Paskha). 2010-12-25 11:52:04 +00:00
Ed Maste
b3f4d7e17c Remove extra ; 2010-09-14 01:33:21 +00:00
Edwin Groothuis
c31776f0f8 For calendars which don't match the solar-based Gregorian calendar,
be able to specify a year string in an entry.
2010-08-30 22:45:32 +00:00
Andrey A. Chernov
e86a8937dc While I am here, add more missing (unsigned char) casts to ctype() macros 2010-05-06 16:54:46 +00:00
Edwin Groothuis
bb06482c77 On request of joel@:
- Remove the 3rd clause of the UC Berkeley copyrighted files.
- For the files added copyrighted by me, move the "All rights
  reserved" to the next line.
2010-03-30 06:42:01 +00:00
Dag-Erling Smørgrav
9d5d3712db size_t is not equivalent to int on 64-bit platforms.
Pointy hat to:	edwin@
2010-03-29 13:20:52 +00:00
Edwin Groothuis
2b84020d5c Long awaited update to the calendar system:
- Repeating events which span multiple years (because of -A, -B or
  just the three days before the end of the year).

- Support for lunar events (full moon, new moon) and solar events
  (equinox and solstice, chinese new year). Because of this, the
  options -U (UTC offset) and -l (longitude) are available to
  compensate if reality doesn't match the calculated values.

MFC after:	1 month
2010-03-29 06:49:20 +00:00