freebsd-src/usr.bin/calendar
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
..
calendars Add myself (akiyano) to calendar.freebsd 2023-11-20 20:50:52 +00:00
tests Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
calendar.1 calendar: correct the search order for files 2023-12-17 23:53:51 -06:00
calendar.c Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
calendar.h Remove $FreeBSD$: two-line .h pattern 2023-08-16 11:54:16 -06:00
dates.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
day.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
events.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
io.c calendar: correct the search order for files 2023-12-17 23:53:51 -06:00
locale.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
Makefile usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
Makefile.depend Remove $FreeBSD$: one-line sh pattern 2023-08-16 11:55:03 -06:00
ostern.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
parsedata.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
paskha.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00
pathnames.h usr.bin: Remove ancient SCCS tags. 2023-11-26 22:23:30 -07:00
pom.c Remove copyright strings ifdef'd out 2023-11-26 22:23:58 -07:00
sunpos.c Remove $FreeBSD$: one-line .c pattern 2023-08-16 11:54:42 -06:00