Skip site navigation (1)Skip section navigation (2)
Date:      Sun, 13 Dec 2020 09:38:51 +0000 (UTC)
From:      =?UTF-8?Q?Stefan_E=c3=9fer?= <se@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r368606 - head/usr.bin/calendar
Message-ID:  <202012130938.0BD9cpTp041055@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: se
Date: Sun Dec 13 09:38:50 2020
New Revision: 368606
URL: https://svnweb.freebsd.org/changeset/base/368606

Log:
  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.

Modified:
  head/usr.bin/calendar/events.c

Modified: head/usr.bin/calendar/events.c
==============================================================================
--- head/usr.bin/calendar/events.c	Sun Dec 13 05:34:14 2020	(r368605)
+++ head/usr.bin/calendar/events.c	Sun Dec 13 09:38:50 2020	(r368606)
@@ -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) {



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202012130938.0BD9cpTp041055>