1
0
mirror of https://git.savannah.gnu.org/git/gnulib.git synced 2025-08-08 17:22:05 +03:00

parse-datetime: handle timezones reentrantly

This API change was prompted by a report by Pádraig Brady in:
https://bug.debian.org/851934#10
To help fix the bug, make parse_datetime2 more reentrant.
* NEWS: Document this incompatible change.
* lib/parse-datetime.h, lib/parse-datetime.y (parse_datetime2):
Add two arguments, the timezone and the timezone name.
All callers changed.  If TZ="..." is specified, use it for
calculating defaults.
* lib/parse-datetime.y: Don't include xalloc.h or use xmalloc, as
this code should be usable in a library.
(mktime_ok, get_effective_timezone):
Accept timezone arg too.  All callers changed.
(get_tz): Remove.
(get_effective_timezone): Check for failures.
* modules/parse-datetime: Add time_r, time_rz.  Remove xalloc.
This commit is contained in:
Paul Eggert
2017-01-20 17:11:55 -08:00
parent dd7a8712b8
commit 4e6e16b3f4
5 changed files with 135 additions and 120 deletions

View File

@@ -20,9 +20,10 @@ setenv
strftime
unsetenv
time
time_r
time_rz
timegm
verify
xalloc
configure.ac:
gl_PARSE_DATETIME