From c6e0073a42fff96c559f712897e837120704247f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stefan=20E=C3=9Fer?= Date: Sun, 13 Dec 2020 09:38:50 +0000 Subject: [PATCH] Fix WITHOUT_ICONV build There was an unprotected use of nl_langinfo() to determine the order of day vs. month in the generated output. When building without ICONV support, the order will be: month, day. --- usr.bin/calendar/events.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/usr.bin/calendar/events.c b/usr.bin/calendar/events.c index 1df2357fb959..1dee2fd74771 100644 --- a/usr.bin/calendar/events.c +++ b/usr.bin/calendar/events.c @@ -202,9 +202,13 @@ event_print_all(FILE *fp) struct event *e; struct tm tm; char dbuf[80]; +#ifdef WITH_ICONV static int d_first; d_first = (*nl_langinfo(D_MD_ORDER) == 'd'); +#else +#define d_first 0 +#endif while (walkthrough_dates(&e) != 0) { if (e) {