]> Savannah Git Hosting - gnulib.git/commit
nstrftime: fix bug with -0000 on Solaris 11
authorPaul Eggert <eggert@cs.ucla.edu>
Tue, 18 Jun 2024 03:47:09 +0000 (20:47 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Tue, 18 Jun 2024 03:47:27 +0000 (20:47 -0700)
commit55bd47e8ef7d6282c4405652c37a52d1c999b464
treeb1b214f35b9dd7e6872d8ba78c96603f3b42574e
parentac2c117fc27e70ea1d623f39266dbc1239919296
nstrftime: fix bug with -0000 on Solaris 11

Problem reported by Bruno Haible in:
https://lists.gnu.org/r/bug-gnulib/2024-06/msg00201.html
* lib/strftime.c (strftime) [!_LIBC]: Move #undef up.
(underlying_strftime) [!_LIBC]: New function, containing most of
what __strftime_internal used to do at the underlying_strftime label.
(get_tm_zone): New function, containing much of what
__strftime_internal used to do for %Z.
Be consistent about using "UTC" rather than "GMT";
this changes behavior only on platforms lacking tm_zone.
(__strftime_internal): Use them to compute time zone abbreviation
when needed.  Make ‘zone’ more local, and compute it only if
needed.  Simplify by removing set_and_revert_tz local var and its
uses; no longer needed now that we have get_tm_zone.  Do not
assume %EZ and %OZ are equivalent to %Z.
ChangeLog
lib/strftime.c