From nobody Sat Oct 30 07:15:19 2021 X-Original-To: freebsd-current@mlmmj.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mlmmj.nyi.freebsd.org (Postfix) with ESMTP id C1E9018198E4 for ; Sat, 30 Oct 2021 07:15:24 +0000 (UTC) (envelope-from se@freebsd.org) Received: from smtp.freebsd.org (smtp.freebsd.org [IPv6:2610:1c1:1:606c::24b:4]) (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 "smtp.freebsd.org", Issuer "R3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4Hh9YS4z5cz4h3n; Sat, 30 Oct 2021 07:15:24 +0000 (UTC) (envelope-from se@freebsd.org) Received: from [IPV6:2003:cd:5f11:ee00:4d98:a069:45f1:9a6] (p200300cd5f11ee004d98a06945f109a6.dip0.t-ipconnect.de [IPv6:2003:cd:5f11:ee00:4d98:a069:45f1:9a6]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client did not present a certificate) (Authenticated sender: se/mail) by smtp.freebsd.org (Postfix) with ESMTPSA id 097DD2C732; Sat, 30 Oct 2021 07:15:23 +0000 (UTC) (envelope-from se@freebsd.org) Message-ID: <6d01974e-216f-b218-06e8-83d055fdc33a@freebsd.org> Date: Sat, 30 Oct 2021 09:15:19 +0200 List-Id: Discussions about the use of FreeBSD-current List-Archive: https://lists.freebsd.org/archives/freebsd-current List-Help: List-Post: List-Subscribe: List-Unsubscribe: Sender: owner-freebsd-current@freebsd.org MIME-Version: 1.0 User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.15; rv:91.0) Gecko/20100101 Thunderbird/91.2.1 Subject: Re: stat(1) isn't honouring locale Content-Language: en-US To: Jamie Landeg-Jones References: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> From: Stefan Esser Cc: freebsd-current@freebsd.org, re@freebsd.org In-Reply-To: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="------------P5JrzA0NKxqomD2i6Y54Ucv2" X-ThisMailContainsUnwantedMimeParts: N This is an OpenPGP/MIME signed message (RFC 4880 and 3156) --------------P5JrzA0NKxqomD2i6Y54Ucv2 Content-Type: multipart/mixed; boundary="------------p30cGKCSNZTlPLN3r0mUVJ01"; protected-headers="v1" From: Stefan Esser To: Jamie Landeg-Jones Cc: freebsd-current@freebsd.org, re@freebsd.org Message-ID: <6d01974e-216f-b218-06e8-83d055fdc33a@freebsd.org> Subject: Re: stat(1) isn't honouring locale References: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> In-Reply-To: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> --------------p30cGKCSNZTlPLN3r0mUVJ01 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Am 29.10.21 um 20:15 schrieb Jamie Landeg-Jones: > stat(1) isn't honouring locale. >=20 > The manual page says: >=20 > -t timefmt > Display timestamps using the specified format. This = format is passed directly to strftime(3). >=20 > strftime(3) says: >=20 > %+ is replaced by national representation of the date and time (t= he format is similar to that produced by date(1)). >=20 > However: >=20 > ----------------------------- > % date > Fri Oct 29 00:14:12 BST 2021 >=20 > % date +%+ > Fri Oct 29 00:14:19 BST 2021 >=20 > % stat -t%+ -f '%Sm' . > Fri Oct 29 00:13:38 BST 2021 > ----------------------------- >=20 > % setenv LANG en_GB.UTF-8 >=20 > % date > Fri 29 Oct 2021 00:14:57 BST >=20 > % date +%+ > Fri 29 Oct 2021 00:15:05 BST >=20 > % stat -t%+ -f '%Sm' . > Fri Oct 29 00:13:38 BST 2021 > ----------------------------- >=20 > Including and adding: >=20 > (void) setlocale(LC_TIME, ""); >=20 > before the call to strftime() in usr.bin/stat/stat.c fixes this >=20 > Is there any reason this isn't in place? Hi Jamie, thank you for reporting this issue and suggesting a fix. I have committed your proposed fix to -CURRENT as Git commit 20f8331aca89= 2ff8 and plan to MFC it to 13-STABLE in a few days. I'm CCing to the release engineer, since this might be a change that we w= ant to include in the upcoming 12.3 release (currently in beta). Regards, STefan --------------p30cGKCSNZTlPLN3r0mUVJ01-- --------------P5JrzA0NKxqomD2i6Y54Ucv2 Content-Type: application/pgp-signature; name="OpenPGP_signature.asc" Content-Description: OpenPGP digital signature Content-Disposition: attachment; filename="OpenPGP_signature" -----BEGIN PGP SIGNATURE----- wsB5BAABCAAjFiEEo3HqZZwL7MgrcVMTR+u171r99UQFAmF88QcFAwAAAAAACgkQR+u171r99UQp mAgAqoBPdVVblATP2yDSx3y51bLmDgRwWnU43lrQ6jyJDHpjLHVpMiVZVyB5qfK5y6dVu1AjJKET emAofZK1d3Y9HVtt2lyJbCQV3+tIm4VYESD+fMJIA/cDermKEpXtAssLKZun9+y6VedoLSfNpw9s LFd1cYhkzZl9U1ldnbF4BSQElyI2BIdqSVm/CSgwEQCe/I2Xm4eYo/kXplMwbhuETrbDUNHvlqRV i7H0Pdv1KBZ/E1e3Q6QzOT5wD5raaguI3lsX1XOSya8Szv8LC6sFUFepDgmXa+etn4fwJc45Zl4u 2K8ICtmBhpkvGQAvZGuWkmahuVdhBYvcVBmpYYjVsg== =JrbL -----END PGP SIGNATURE----- --------------P5JrzA0NKxqomD2i6Y54Ucv2--