Look in getlocalbase() for the calendar-data package data

Fix d20d655018 where getlocalbase()
wasn't used to fill out the printf(3) format of _PATH_INCLUDE_LOCAL.

Differential Revision:	https://reviews.freebsd.org/D38975
Reviewed by:	imp
This commit is contained in:
David E. O'Brien 2023-03-07 19:51:27 -08:00
parent 84eac07049
commit 65e9eb0701

View File

@ -151,9 +151,12 @@ cal_fopen(const char *file)
}
warnx("can't open calendar file \"%s\"", file);
if (!warned && stat(_PATH_INCLUDE_LOCAL, &sb) != 0) {
warnx("calendar data files now provided by calendar-data pkg.");
warned = true;
if (!warned) {
snprintf(path, sizeof(path), _PATH_INCLUDE_LOCAL, getlocalbase());
if (stat(path, &sb) != 0) {
warnx("calendar data files now provided by calendar-data pkg.");
warned = true;
}
}
return (NULL);