From: Paul Eggert Date: Sun, 16 Jun 2024 22:48:24 +0000 (-0700) Subject: nstrftime: omit never-used code X-Git-Url: https://gitweb.git.savannah.gnu.org/gitweb/?a=commitdiff_plain;h=7713fcd1c3c9f6522fdf4374a16730d40a6bb60e;p=gnulib.git 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. --- diff --git a/ChangeLog b/ChangeLog index b93e4b0c32..52c07bde4f 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,5 +1,10 @@ 2024-06-16 Paul Eggert + 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, <m);