From 65e9eb07012a0bf2d6940175c98fb463d169c984 Mon Sep 17 00:00:00 2001 From: "David E. O'Brien" Date: Tue, 7 Mar 2023 19:51:27 -0800 Subject: [PATCH] Look in getlocalbase() for the calendar-data package data Fix d20d6550187a95a78bb532909aad8ef7ac62be66 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 --- usr.bin/calendar/io.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/usr.bin/calendar/io.c b/usr.bin/calendar/io.c index 5afcb1a33314..5a77455d0ff6 100644 --- a/usr.bin/calendar/io.c +++ b/usr.bin/calendar/io.c @@ -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);