]> Savannah Git Hosting - gnulib.git/commit
parse-datetime: don’t depend on tzname
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 16 Jun 2024 21:58:56 +0000 (14:58 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 16 Jun 2024 23:38:20 +0000 (16:38 -0700)
commit75f19d5efbb51ae1e82b11b183767bf7ed726cfd
tree991f4bda1c4251bb20719faff805f777e3c2cbc1
parentd320360f8751e9ea39a0ac1a68299c55a3b6468a
parse-datetime: don’t depend on tzname

* lib/parse-datetime.y (TIME_ZONE_BUFSIZE): Move earlier.
(parser_control) [!HAVE_STRUCT_TM_TM_ZONE]:
New member tz_abbr, to save abbrs calculated by strftime %Z.
(populate_local_time_zone_table): New function, which
optimizes the HAVE_STRUCT_TM_TM_ZONE case as before,
and falls back on strftime with %Z otherwise.
Although strftime %Z can be more accurate than the old tzname
based method, the new heuristic is still wrong so often that it
probably doesn’t help all that much.
(parse_datetime_body): Use it.
* modules/parse-datetime (Depends-on): Remove tzname.
ChangeLog
lib/parse-datetime.y
modules/parse-datetime