Date: Fri, 18 Nov 2016 18:03:23 +0900 From: Hajimu UMEMOTO <ume@FreeBSD.org> To: Jean-S9bastien P9dron <dumbbell@FreeBSD.org> Cc: freebsd-current@freebsd.org Subject: Re: Some locale data are broken Message-ID: <ygevavlf9d0.wl-ume@FreeBSD.org> In-Reply-To: <03581e2e-2379-1cd3-225c-ec49af563b28@FreeBSD.org> References: <bc808e91-e35f-a0e4-081c-f083a2a372b7@FreeBSD.org> <03581e2e-2379-1cd3-225c-ec49af563b28@FreeBSD.org>
next in thread | previous in thread | raw e-mail | index | archive | help
--Multipart_Fri_Nov_18_18:03:23_2016-1
Content-Type: text/plain; charset=US-ASCII
Hi,
>>>>> On Fri, 18 Nov 2016 09:35:01 +0100
>>>>> Jean-S9bastien P9dron <dumbbell@FreeBSD.org> said:
dumbbell> What looks incorrect to me is the output of `locale -k` when no keyword
dumbbell> is specified:
dumbbell> $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k
dumbbell> ...
dumbbell> d_fmt="%m/%d/%y"
dumbbell> ...
dumbbell> altmon_1="January"
dumbbell> ...
dumbbell> $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k d_fmt
dumbbell> d_fmt="%d.%m.%Y"
dumbbell> $ LANG=fr_FR.UTF-8 LC_ALL=fr_FR.UTF-8 locale -k altmon_1
dumbbell> altmon_1="janvier"
How about this patch?
Sincerely,
--Multipart_Fri_Nov_18_18:03:23_2016-1
Content-Type: text/plain; type=patch; charset=US-ASCII
Content-Disposition: attachment; filename="locale.c-prt_keywords-setlocale.diff"
Content-Transfer-Encoding: 7bit
Index: usr.bin/locale/locale.c
===================================================================
--- usr.bin/locale/locale.c (revision 308220)
+++ usr.bin/locale/locale.c (working copy)
@@ -283,8 +283,9 @@
/* process '-c', '-k', or command line arguments. */
if (prt_categories || prt_keywords || argc > 0) {
+ if (prt_keywords)
+ setlocale(LC_ALL, "");
if (argc > 0) {
- setlocale(LC_ALL, "");
while (argc > 0) {
showdetails(*argv);
argv++;
--Multipart_Fri_Nov_18_18:03:23_2016-1
Content-Type: text/plain; charset=US-ASCII
--
Hajimu UMEMOTO
ume@mahoroba.org ume@FreeBSD.org
http://www.mahoroba.org/~ume/
--Multipart_Fri_Nov_18_18:03:23_2016-1--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?ygevavlf9d0.wl-ume>
