Commit Graph

43 Commits

Author SHA1 Message Date
grog
6cb4f60635 Remove spurious transition from Julian to Gregorian for country
"Latin".

Arguably the entire -p option should be removed.  It shows only a few
countries, and it doesn't have any relationship with the rest of the
program.

PR:		244801
Submitted by:	grog@
Reported by:	Hamid Ali
2020-03-29 04:18:27 +00:00
imp
ffaf48277f Based on multiple sources including the State Gazette the last day of
Julian calendar in Bulgaria was 31.03.1916.

Submitted by: Konstantin Terziev
Pull Request: https://github.com/freebsd/freebsd/pull/142

(I independently confirmed the date and this was the right date to use for ncal)
2018-05-18 16:19:45 +00:00
pfg
7551d83c35 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
vangyzen
e950451b7a ncal: fix a reference to an out-of-scope stack buffer
PR:		214237
Submitted by:	Jonathan de Boyne Pollard
MFC after:	3 days
Sponsored by:	Dell EMC
2016-11-05 14:08:14 +00:00
truckman
2c197aaf2a swprintf() and apparently wcsftime() want the their output buffer size
specified in terms of the the number of wide characters and not
sizeof(buffer).

Reported by:	Coverity
CID:		1007605, 1007606
MFC after:	1 week
2016-05-17 05:05:30 +00:00
ed
af31e8843c More -Wmissing-variable-declarations fixes.
In addition to adding `static' where possible:

- bin/date: Move `retval' into extern.h to make it visible to date.c.
- bin/ed: Move globally used variables into ed.h.
- sbin/camcontrol: Move `verbose' into camcontrol.h and fix shadow warnings.
- usr.bin/calendar: Remove unneeded variables.
- usr.bin/chat: Make `line' local instead of global.
- usr.bin/elfdump: Comment out unneeded function.
- usr.bin/rlogin: Use _Noreturn instead of __dead2.
- usr.bin/tset: Pull `Ospeed' into extern.h.
- usr.sbin/mfiutil: Put global variables in mfiutil.h.
- usr.sbin/pkg: Remove unused `os_corres'.
- usr.sbin/quotaon, usr.sbin/repquota: Remove unused `qfname'.
2012-10-19 14:49:42 +00:00
maxim
ee11c10158 o Use ISO 3166 county code for Sweden.
PR:		standards/165400
Submitted by:	Carsten Hey
MFC after:	1 week
2012-02-22 21:08:58 +00:00
edwin
c1425b09de ncal(1) highlights the current date (or a date provided via parameter)
even if stdout is not a tty. If stdout is not a tty the data is
normally processed by other tools and no control sequences are
expected.

PR:		bin/158580
MFC after:	1 week
2011-07-11 10:41:08 +00:00
edwin
c7ca9646c7 Use basename(3) to determine the name of the program.
Submitted by:	Alexander Best <arundel@>
2010-08-30 22:24:26 +00:00
edwin
9792f6e953 Replace -b with -C and -B (as proposed by Alexander).
Add -3, -A and -B to the usage.
Update regression test for the new parameters.
2010-03-21 21:33:21 +00:00
edwin
4bb7c695aa - With the introduction of -A, -B and -3, not all combinations of
arguments makes sense anymore. For example, what would a combination
  of -3 (show three months) and -y (show the whole year) do?
  We will abort on these cases.
- Move the debug option -d to -H (from highlight), while -d is now
  used for setting the day of "today" so that -y and friends can
  be tested.
2010-03-12 06:57:53 +00:00
edwin
03f7b71a7a - Fix the highlighting for non-terminals when the last week is not
7 days long.
- "-m <N> <YYYY>" now prints only the month, not the whole year.
2010-03-09 06:43:35 +00:00
edwin
3845e03a2d - document the -3, -A and -B properly in Synopsis.
- add highlight of current date for non-terminals.
- fix -J option.
- code cleanup.

MFC after:	2 weeks
2010-03-07 21:54:28 +00:00
edwin
e27eb9f6a0 - Implement -3 option (show previous, this and next month) option.
- Add -A option (months after this month).
- Add -B option (months before this month).
- Fix highlighting of today in year overview.
- Fix aligning of "foreign" characters.

MFC after:	2 weeks
2010-03-04 07:04:27 +00:00
delphij
0842b7d53f Revert most part of 200420 as requested, as more review and polish is
needed.
2009-12-13 03:14:06 +00:00
delphij
b963db4652 Remove unneeded header includes from usr.bin/ except contributed code.
Tested with:	make universe
2009-12-11 23:35:38 +00:00
ume
1df3802387 Since the width is always 2, it is enough to put just one
trailing space is enough.

MFC after:	1 week
2009-06-18 16:40:00 +00:00
ume
a48b416441 Fix column width of weekday names for multibyte locales.
Noticed by:	nyan
Discussed with:	matusita, takawata
MFC after:	1 week
2009-06-17 14:47:06 +00:00
rdivacky
01e492e006 Mention -h in usage() and manpage. Rename term_{r,e} to term_{so,se}.
Suggested by:	ru
Approved by:	ed (mentor)
2009-05-02 07:02:31 +00:00
ru
e9ac1c9e24 Fixed multi-byte character support to actually work. 2009-04-30 13:53:00 +00:00
rdivacky
657f6b7fcd Couple of changes based on feedback
o	Change mr/me to so/se [1].
	o	Introduce a -h option to disable highlighting. [2]
	o	Spell STDOUT_FILENO as such and pass NULL to tgetent()
		to handle the case of unset TERM. [3]

Suggested by:	naddy mips.inka.de (Christian Weisgerber) [1]
Requested by:	danfe, deischen	[2]
Suggested by:	jmallett	[3]
Approved by:	ed (mentor)
2009-04-21 17:44:46 +00:00
rdivacky
beb2b3b1a7 Implement highlighting of today in month view of cal/ncal just like
gnu cal does. This is currently disabled for year view because of hard
coded padding in that case. This will hopefully be fixed soon.

Reviewed by:	Simon 'corecode' Schubert <corecode fs.ei.tum.de>
Approved by:	ed
2009-04-20 18:19:38 +00:00
das
fbe19d09d8 Multibyte character support for cal(1).
PR:		131578
2009-03-14 18:55:51 +00:00
wollman
3dff28c944 Implement a new feature for the "-m" option: if the month number is
followed by 'f' or 'p', use the following or preceding month of that
number, respectively.  Document this.  Also includes other minor
grammatical and punctuation fixes to the manual page (capitalize
Easter, etc.).

MFC after:	1 month
2008-12-22 21:22:42 +00:00
wollman
b59dbc2123 Add a `-m month' flag to provide a more convenient interface for
displaying a calendar for a specific month of the current year than
`cal $(date +"%Y") month'.  A few minor code cleanups.  Set WARNS=1.
(This code is WARNS=5 clean except for "`O' modifier used with `%B'
strftime format", which is legal in FreeBSD but GCC doesn't know about.)

MFC after:	1 week
2004-11-23 22:57:17 +00:00
roam
e474e1f04d Teach ncal(1) about month names specified on the command line.
Reviewed by:	-audit
Approved by:	silence on -audit
MFC after:	3 weeks
2002-10-02 12:31:10 +00:00
markm
ed297fee6f Easy warns fixes; constify. 2002-04-28 12:25:03 +00:00
ache
2575a21628 Handle ASCII and US-ASCII aliases 2001-06-10 23:26:47 +00:00
ache
1988303641 Remove "SU" - not valid country code
Fix locale comparison with "C", add "POSIX"
2001-06-10 21:06:01 +00:00
ache
1cd25e1101 Properly deal with one char weekdays 2001-03-22 00:38:46 +00:00
ache
d993b34b6d Uppercase first month letter
Terminate weekday string
2001-03-22 00:25:26 +00:00
ache
a94919d097 Use nl_langinfo instead of %EF 2001-03-21 14:24:05 +00:00
ache
f05bfcb43f Use %EF instead of hardcoded order for each country 1999-11-30 20:08:50 +00:00
ache
f882733396 use %OB for months names 1999-09-12 13:33:33 +00:00
peter
3b842d34e8 $Id$ -> $FreeBSD$ 1999-08-28 01:08:13 +00:00
billf
4822432874 Clean up some ambiguous nested if/elses. 1999-07-04 17:26:16 +00:00
helbig
807da996a2 Due to the switch form Julian to Gregorian calender,
even a whole month might be missing.
This caused a bug for the LN -calender, whose switch was
on Dec 12, 9999.
1999-03-27 21:08:13 +00:00
helbig
d9865a0ff5 Handle option -j correctly.
Synchronize usage message with man page.
PR:	bin/5488
1998-01-15 10:23:34 +00:00
charnier
3210047753 Sync usage and synopsis. Add rcsid. 1998-01-07 07:46:33 +00:00
helbig
847d460dbd 1. Don't be confused if the first day of a month is dropped due to
Gregorian Reformation. E. G. in Albania December 1, 1912 doesn't exist.
2. Add some countries in the switch table (BE, FI, LN, LU)
3. Correct some entries from the new found source of calendar knowledge:
   http://www.pip.dknet.dk/~c-t/calendar.html,
   That is Claus Tondering's Calendar FAQ.
1998-01-06 00:46:11 +00:00
helbig
fde202285d Use locale to guess the switch date.
Localize formatting of date of easter.
Suggested by:	ache
1998-01-03 15:10:11 +00:00
helbig
d3af2f22a4 Ensure 2 letter abbreviations of weekdays (even if LANG=C
and invoked as "cal").
1997-12-31 15:55:08 +00:00
helbig
089f2900a3 Add new command ncal. 1997-12-15 20:35:22 +00:00