From owner-svn-src-head@freebsd.org Tue Nov 3 12:15:08 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id D8219456E2C; Tue, 3 Nov 2020 12:15:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (4096 bits) server-digest SHA256 client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4CQTHw5JLVz3Y5g; Tue, 3 Nov 2020 12:15:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id 993CE1A343; Tue, 3 Nov 2020 12:15:08 +0000 (UTC) (envelope-from se@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 0A3CF83d050304; Tue, 3 Nov 2020 12:15:08 GMT (envelope-from se@FreeBSD.org) Received: (from se@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 0A3CF8Dt050303; Tue, 3 Nov 2020 12:15:08 GMT (envelope-from se@FreeBSD.org) Message-Id: <202011031215.0A3CF8Dt050303@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: se set sender to se@FreeBSD.org using -f From: =?UTF-8?Q?Stefan_E=c3=9fer?= Date: Tue, 3 Nov 2020 12:15:08 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r367293 - head/usr.bin/calendar X-SVN-Group: head X-SVN-Commit-Author: se X-SVN-Commit-Paths: head/usr.bin/calendar X-SVN-Commit-Revision: 367293 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.33 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 03 Nov 2020 12:15:08 -0000 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();