* lib/strftime.c (__strftime_internal): Remove code protected by
‘#ifndef my_strftime’.  my_strftime is always defined.  This
code isn’t needed for POSIX conformance as it’s never used in glibc.
---
 ChangeLog      |  6 ++++++
 lib/strftime.c | 10 ----------
 2 files changed, 6 insertions(+), 10 deletions(-)

diff --git a/ChangeLog b/ChangeLog
index b93e4b0c32..52c07bde4f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-06-16  Paul Eggert  <egg...@cs.ucla.edu>
 
+       nstrftime: omit never-used code
+       * lib/strftime.c (__strftime_internal): Remove code protected by
+       ‘#ifndef my_strftime’.  my_strftime is always defined.  This
+       code isn’t needed for POSIX conformance as it’s never used in glibc.
+
        nstrftime,time_rz: don’t depend on tzname
        * lib/strftime.c (HAVE_TZNAME_ARRAY) [_LIBC]: Remove.
        All uses removed.
@@ -9,6 +14,7 @@
        underlying strftime with %Z, making sure that call to the
        underlying strftime is now always compiled in the non-glibc case.
        Set and revert TZ as needed around the underlying call.
+
        * lib/time-internal.h (struct tm_zone)
        [HAVE_TZNAME_ARRAY && !HAVE_STRUCT_TM_TM_ZONE]: Remove tzname_copy.
        All uses removed.
diff --git a/lib/strftime.c b/lib/strftime.c
index 6688c90e11..e33dbb8f7c 100644
--- a/lib/strftime.c
+++ b/lib/strftime.c
@@ -2020,16 +2020,6 @@ __strftime_internal (STREAM_OR_CHAR_T *s, STRFTIME_ARG 
(size_t maxsize)
                 struct tm ltm;
                 time_t lt;
 
-                /* POSIX.1 requires that local time zone information be used as
-                   though strftime called tzset.  */
-# ifndef my_strftime
-                if (!*tzset_called)
-                  {
-                    tzset ();
-                    *tzset_called = true;
-                  }
-# endif
-
                 ltm = *tp;
                 ltm.tm_wday = -1;
                 lt = mktime_z (tz, &ltm);
-- 
2.43.0


Reply via email to