]> Savannah Git Hosting - gnulib.git/commit
nstrftime,time_rz: don’t depend on tzname
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 16 Jun 2024 22:44:17 +0000 (15:44 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 16 Jun 2024 23:38:21 +0000 (16:38 -0700)
commitacb87f5090820b3a856456b9707b940aaea85d2b
tree9104f3c744cdca077f8a24f08ea95dc97966e837
parent75f19d5efbb51ae1e82b11b183767bf7ed726cfd
nstrftime,time_rz: don’t depend on tzname

* lib/strftime.c (HAVE_TZNAME_ARRAY) [_LIBC]: Remove.
All uses removed.
(__strftime_internal): Simplify calculation of zone to be closer
to what glibc does.  However, in Gnulib do not look at tzname as
this is problematic for all the usual reasons; instead, use the
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.
(set_tz, revert_tz): Declare, as they’re now extern.
(local_tz): Move here from time_rz.c, and now a macro.
* lib/time_rz.c (save_abbr): Do not worry about tzname_copy,
since strftime.c no longer needs it.  Instead, save abbrs
only from tm_zone.
* modules/c-nstrftime, modules/nstrftime, modules/time_rz:
(Depends-on): Remove tzname.
ChangeLog
lib/strftime.c
lib/time-internal.h
lib/time_rz.c
modules/c-nstrftime
modules/nstrftime
modules/time_rz