]> Savannah Git Hosting - gnulib.git/commit
posixtm: remove PDS_LEADING_YEAR
authorPaul Eggert <eggert@cs.ucla.edu>
Fri, 24 Nov 2017 08:29:04 +0000 (00:29 -0800)
committerPaul Eggert <eggert@cs.ucla.edu>
Fri, 24 Nov 2017 08:29:37 +0000 (00:29 -0800)
commitce9dee4b2eb11d1a659d4ef595c4e699285882c0
treec2cb17f5681dc75373975b66761ee8663222c29a
parentb9d0b50f6cd122a1748e1e5b79ecca7a0fef214e
posixtm: remove PDS_LEADING_YEAR

This changes the API slightly, in a hopefully-innocuous way.
Without this change the code had undefined behavior when a
caller specified neither PDS_LEADING_YEAR nor PDS_TRAILING_YEAR.
Problem reported by Pádraig Brady in:
https://lists.gnu.org/r/bug-gnulib/2017-11/msg00048.html
* NEWS: Mention this.
* lib/posixtm.c (posix_time_parse): Treat the absence of
PDS_TRAILING_YEAR as if PDS_LEADING_YEAR were present.
* lib/posixtm.h (PDS_LEADING_YEAR): Remove (actually, leave it
present, but define it as zero, for compatibility with existing
source code).  All other PDS_* values moved up.
* tests/test-posixtm.c (LY): New macro.
(T): Use it.  Do not expect a particular numeric encoding
for PDS_CENTURY etc.
ChangeLog
NEWS
lib/posixtm.c
lib/posixtm.h
tests/test-posixtm.c