From nobody Fri Oct 29 18:15:10 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 A6F90181A55D for ; Fri, 29 Oct 2021 18:15:17 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [IPv6:2001:19f0:300:2185:123::1]) by mx1.freebsd.org (Postfix) with ESMTP id 4HgrFJ5PLKz4vfg for ; Fri, 29 Oct 2021 18:15:16 +0000 (UTC) (envelope-from jamie@catflap.org) Received: from donotpassgo.dyslexicfish.net (donotpassgo.dyslexicfish.net [104.207.135.49]) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5) with ESMTP id 19TIFAGi072517 for ; Fri, 29 Oct 2021 19:15:10 +0100 (BST) (envelope-from jamie@donotpassgo.dyslexicfish.net) Received: (from jamie@localhost) by donotpassgo.dyslexicfish.net (8.14.5/8.14.5/Submit) id 19TIFARt072516 for freebsd-current@freebsd.org; Fri, 29 Oct 2021 19:15:10 +0100 (BST) (envelope-from jamie) From: Jamie Landeg-Jones Message-Id: <202110291815.19TIFARt072516@donotpassgo.dyslexicfish.net> Date: Fri, 29 Oct 2021 19:15:10 +0100 Organization: Dyslexic Fish To: freebsd-current@freebsd.org Subject: stat(1) isn't honouring locale User-Agent: Heirloom mailx 12.4 7/29/08 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 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Greylist: Sender passed SPF test, not delayed by milter-greylist-4.2.7 (donotpassgo.dyslexicfish.net [104.207.135.49]); Fri, 29 Oct 2021 19:15:10 +0100 (BST) X-Rspamd-Queue-Id: 4HgrFJ5PLKz4vfg X-Spamd-Bar: --- Authentication-Results: mx1.freebsd.org; dkim=none; dmarc=pass (policy=none) header.from=catflap.org; spf=pass (mx1.freebsd.org: domain of jamie@catflap.org designates 2001:19f0:300:2185:123::1 as permitted sender) smtp.mailfrom=jamie@catflap.org X-Spamd-Result: default: False [-3.70 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000]; FREEFALL_USER(0.00)[jamie]; FROM_HAS_DN(0.00)[]; TO_MATCH_ENVRCPT_ALL(0.00)[]; R_SPF_ALLOW(-0.20)[+mx:dyslexicfish.net]; MIME_GOOD(-0.10)[text/plain]; TO_DN_NONE(0.00)[]; PREVIOUSLY_DELIVERED(0.00)[freebsd-current@freebsd.org]; RCPT_COUNT_ONE(0.00)[1]; HAS_ORG_HEADER(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000]; DMARC_POLICY_ALLOW(-0.50)[catflap.org,none]; NEURAL_HAM_SHORT(-1.00)[-0.999]; RCVD_NO_TLS_LAST(0.10)[]; FROM_EQ_ENVFROM(0.00)[]; R_DKIM_NA(0.00)[]; MIME_TRACE(0.00)[0:+]; RCVD_COUNT_TWO(0.00)[2]; ASN(0.00)[asn:20473, ipnet:2001:19f0::/38, country:US] X-ThisMailContainsUnwantedMimeParts: N stat(1) isn't honouring locale. The manual page says: -t timefmt Display timestamps using the specified format. This format is passed directly to strftime(3). strftime(3) says: %+ is replaced by national representation of the date and time (the format is similar to that produced by date(1)). However: ----------------------------- % date Fri Oct 29 00:14:12 BST 2021 % date +%+ Fri Oct 29 00:14:19 BST 2021 % stat -t%+ -f '%Sm' . Fri Oct 29 00:13:38 BST 2021 ----------------------------- % setenv LANG en_GB.UTF-8 % date Fri 29 Oct 2021 00:14:57 BST % date +%+ Fri 29 Oct 2021 00:15:05 BST % stat -t%+ -f '%Sm' . Fri Oct 29 00:13:38 BST 2021 ----------------------------- Including and adding: (void) setlocale(LC_TIME, ""); before the call to strftime() in usr.bin/stat/stat.c fixes this Is there any reason this isn't in place? Cheers, Jamie