Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 3 Nov 2020 12:15:08 +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: r367293 - head/usr.bin/calendar
Message-ID:  <202011031215.0A3CF8Dt050303@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: se
Date: Tue Nov  3 12:15:08 2020
New Revision: 367293
URL: https://svnweb.freebsd.org/changeset/base/367293

Log:
  Consistently print calendar dates in the locale of the user
  
  Calendar files that specify LANG=... to specify their character encoding did
  also set the date format defined for that locale, resulting in output like:
  
  Nov  4 	Gabriel Faure dies from pneumonia in Paris, France, 1924
   4 nov. 	N'oubliez pas les Charles !
  
  After this commit the output is always printed in a consistent format
  according to the user's current locale, e.g.:
  
  Nov  4 	Gabriel Faure dies from pneumonia in Paris, France, 1924
  Nov  4 	N'oubliez pas les Charles !
  
  I'll open a review asking for opinions whether this format change should
  be merged to -STABLE.
  
  Relnotes:	yes

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

Modified: head/usr.bin/calendar/io.c
==============================================================================
--- head/usr.bin/calendar/io.c	Tue Nov  3 11:37:19 2020	(r367292)
+++ head/usr.bin/calendar/io.c	Tue Nov  3 12:15:08 2020	(r367293)
@@ -468,8 +468,7 @@ cal_parse(FILE *in, FILE *out)
 		 * and does not run iconv(), this variable has little use.
 		 */
 		if (strncmp(buf, "LANG=", 5) == 0) {
-			(void)setlocale(LC_ALL, buf + 5);
-			d_first = (*nl_langinfo(D_MD_ORDER) == 'd');
+			(void)setlocale(LC_CTYPE, buf + 5);
 #ifdef WITH_ICONV
 			if (!doall)
 				set_new_encoding();



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