Thanks for the bug report. I installed the attached, which should have
the same effect as what you suggested albeit with slightly simpler
machine code.
From d0e0b00f846c3f8b61ad2da7f4361fc790c82c37 Mon Sep 17 00:00:00 2001
From: Paul Eggert <[email protected]>
Date: Fri, 29 Aug 2025 23:12:42 -0700
Subject: [PROPOSED] Avoid unnecessary access, stat calls
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit
Problem reported by Dag-Erling Smørgrav in:
https://lists.iana.org/hyperkitty/list/[email protected]/thread/5RZL3MJKUIQKKFR6TSUGEEUUQ63N3X7A/
* localtime.c (tzloadbody): If using TZDEFAULT, ignore
TZLOAD_FROMENV because TZDEFAULT didn’t come from the environment.
---
localtime.c | 1 +
1 file changed, 1 insertion(+)
diff --git a/localtime.c b/localtime.c
index 96737ca6..f534383b 100644
--- a/localtime.c
+++ b/localtime.c
@@ -535,6 +535,7 @@ tzloadbody(char const *name, struct state *sp, char tzloadflags,
name = TZDEFAULT;
if (! name)
return EINVAL;
+ tzloadflags &= ~TZLOAD_FROMENV;
}
if (name[0] == ':')
--
2.48.1