]> Savannah Git Hosting - gnulib.git/commitdiff
nstrftime: omit never-used code
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 16 Jun 2024 22:48:24 +0000 (15:48 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 16 Jun 2024 23:38:21 +0000 (16:38 -0700)
* 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
lib/strftime.c

index b93e4b0c327129fb663f59bd74103ded1e38231c..52c07bde4f8d1c5097f816f6fd9f03b6bf6f20f3 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,5 +1,10 @@
 2024-06-16  Paul Eggert  <eggert@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.
index 6688c90e11d29acb8c8cef3e0d874ac960dba776..e33dbb8f7cc4372d8f4355cb05bddbec5f96a067 100644 (file)
@@ -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);