freebsd-src/usr.bin
Kyle Evans 0a82cd4f10 calendar: correct the search order for files
Include files that don't begin with a '/' are documented to search the
current directory, then /usr/share/calendar.  This hasn't been accurate
for years, since e061f95e7b ("Rework calendar(1) parser") rewrote a
lot of this.

Stash off the cwd before we do any chdir()ing around and use that to
honor the same order we'll follow for the -f flag.  This may result in
an extra lookup that will fail for the initial calendar file, but I
don't think it's worth the complexity to avoid it.

While we're here, fix the documentation to just reference the order
described in FILES so that we only need to keep it up to date in one
place.

Reviewed by:	bapt
Sponsored by:	Klara, Inc.
Differential Revision:	https://reviews.freebsd.org/D42278
2023-12-17 23:53:51 -06:00
..
addr2line dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
alias
apply usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ar
asa
at at.man: Move examples to the EXAMPLES section 2023-09-18 23:59:10 +02:00
awk awk(1): Fix typo 2023-12-17 18:40:29 +08:00
backlight
banner Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
basename Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
bc usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
beep
biff Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
bintrans Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
bluetooth Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
bmake Merge bmake-20230909 2023-09-17 18:09:37 -07:00
brandelf usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
bsdcat
bsddialog bsddialog: import version 1.0 2023-10-04 18:12:03 +02:00
bsdiff usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
bzip2
bzip2recover
c89
c99 usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
caesar Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
calendar calendar: correct the search order for files 2023-12-17 23:53:51 -06:00
cap_mkdb Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
chat usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
chkey usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
chpass usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
cksum usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
clang Merge llvm-project main llvmorg-17-init-19304-gd0b54bb50e51 2023-12-08 18:34:50 +01:00
cmp usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
col Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
colrm Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
column Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
comm Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
compile_et
compress Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
cpio
csplit usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ctags usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ctlstat usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
cut sccs: Manual changes 2023-11-26 22:23:58 -07:00
cxxfilt dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
dc usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
diff usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
diff3 usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
dirname Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
dpv
drill
dtc dtc: Ensure it is built in C++17 mode 2023-09-29 09:26:51 -04:00
du Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ee Remove $FreeBSD$: one-line catalog 2023-08-16 11:55:26 -06:00
elfctl Connect mitigations(7) to the build 2023-10-05 21:48:27 -04:00
elfdump usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
enigma usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
env Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
etdump
expand Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
factor sccs: Manual changes 2023-11-26 22:23:58 -07:00
false Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
fetch usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
file file: Support testing multiple magic files. 2023-10-09 10:44:42 -07:00
file2c
find usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
finger usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
fmt usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
fold Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
fortune Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
from Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
fstat fstat(1): Fix typo 2023-12-17 18:41:53 +08:00
fsync usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ftp usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
gcore Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
gencat
genl genl: add a monitor subcommand 2023-10-05 12:53:47 +02:00
getaddrinfo usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
getconf usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
getent
getopt Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
gh-bc
gprof usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
grdc Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
grep usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
gzip Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
head Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
hesinfo
hexdump usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
host
iconv usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
id Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ident usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
indent usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ipcrm usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ipcs usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
iscsictl
join Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
jot Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
kdump kdump: use print_mask_arg0 appropriately 2023-12-13 10:49:03 -06:00
keylogin usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
keylogout usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
killall usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ktrace usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ktrdump usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
kyua Remove $FreeBSD$: one-line lua tag 2023-08-16 11:55:34 -06:00
lam Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
last Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
lastcomm usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ldd usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
ldd32
leave Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
less less: We have <stdckdint.h> now. 2023-09-07 06:40:14 +00:00
lessecho
lesskey
lex usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
limits
locale
localedef usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
locate Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
lock Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
lockf usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
logger Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
login usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
logins Remove my middle name. 2023-08-17 15:08:30 +02:00
logname Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
look look(1): Correct the example's description 2023-12-12 02:19:21 +08:00
lorder usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
lsvfs usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
lzmainfo
m4 usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
mail usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
man switch groff parameter -man to -mandoc for new groff release 1.23.0 2023-09-07 14:59:12 +00:00
mandoc
mesg Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ministat usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
mkcsmapper usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
mkcsmapper_static
mkdep usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
mkesdb usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
mkesdb_static
mkfifo Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
mkimg mkimg(1): Fix typo 2023-12-17 18:49:28 +08:00
mkstr Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
mktemp Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
mkuzip usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
morse Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
msgs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
mt mt(1): Fix typo 2023-12-17 18:49:42 +08:00
nc
ncal
ncurses
netstat usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
newgrp usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
newkey usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
nfsstat Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
nice Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
nl Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
nm dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
nohup Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
number Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
objcopy
ofed
pagesize usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
pamtest
passwd usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
paste Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
patch patch: fix locate_hunk in empty files 2023-12-03 12:33:03 -05:00
pathchk usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
perror
pom Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
posixshmcontrol usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
pr usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
primes usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
printenv Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
printf Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
proccontrol Connect mitigations(7) to the build 2023-10-05 21:48:27 -04:00
procstat usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
protect
quota usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
random usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
rctl usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
readelf dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
renice Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
resizewin
rev Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
revoke
rpcgen sccs: Manual changes 2023-11-26 22:23:58 -07:00
rpcinfo usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
rs usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
rup
ruptime Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
rusers usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
rwall Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
rwho Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
script Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
sdiff usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
sdiotool
sed Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
seq
shar usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
showmount Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
size dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
smbutil
sockstat usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
soelim usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
sort sort: Only build FreeBSD-specific ALTMON_x stuff when ATLMON_1 is defined 2023-12-07 13:42:52 -07:00
split Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ssh-copy-id
stat
stdbuf
strings dirdeps: Update/fix Makefile.depend* for toolchain 2023-11-26 20:50:13 -05:00
su Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
systat usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
tabs usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
tail tail: Clean up error messages. 2023-11-29 22:49:44 +01:00
talk usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
tar
tcopy Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
tee Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
telnet
tests
tftp usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
time Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
tip usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
top Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
touch Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
tr pkgbase: Move tr(1) to runtime 2023-12-09 12:21:02 +01:00
true Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
truncate Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
truss Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
tsort Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
tty Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ul Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
uname Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
unexpand Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
unifdef usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
uniq Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
units Purge more stray embedded $FreeBSD$ strings 2023-09-25 07:54:56 -07:00
unvis usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
unzip
usbhidaction Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
usbhidctl Remove $FreeBSD$: one-line nroff pattern 2023-08-16 11:55:15 -06:00
users usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
vacation
vgrind Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
vi nvi: import version 2.2.1 2023-09-27 18:14:45 +02:00
vis usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
vmstat vmstat: Rely on libxo for numbers humanization 2023-12-07 21:21:35 -05:00
vtfontcvt usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
w usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
wall Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
wc Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
wg
what Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
whereis usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
which usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
who usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
whois Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
write Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
xargs Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
xinstall Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
xo
xohtml
xolint
xopo
xstr Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
xz
xzdec
yacc usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
yes Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
ypcat usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
ypmatch usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
ypwhich usr.bin: Automated cleanup of cdefs and other formatting 2023-11-26 22:24:01 -07:00
zstd
Makefile usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.amd64
Makefile.arm
Makefile.i386
Makefile.inc usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.powerpc