]> git.eshelyaron.com Git - emacs.git/commit
Fix off-by-one bug in ISO 8601 BC years
authorPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Oct 2019 04:23:15 +0000 (21:23 -0700)
committerPaul Eggert <eggert@cs.ucla.edu>
Sun, 6 Oct 2019 04:24:09 +0000 (21:24 -0700)
commit9d829b8be5b86668d5165b9d0c0cdc392b558dd3
treeb2dc5d94b96bf540fdfde80a33f93bf4b4018e66
parentaadf72167673c8702531ba3802e3d5f137f139ba
Fix off-by-one bug in ISO 8601 BC years

* lisp/calendar/iso8601.el (iso8601--year-match)
(iso8601--full-date-match, iso8601--without-day-match)
(iso8601--week-date-match, iso8601--ordinal-date-match)
(iso8601-parse-date):
Don’t bother to separate the year’s sign from the year,
as that distinction is not needed: ISO 8601 uses
astronomical year numbering with a year zero, which
is what the Emacs time functions use, so there’s no
need to treat nonpositive years specially.
(iso8601--adjust-year): Remove; no longer needed
since callers can just use string-to-number.
* test/lisp/calendar/iso8601-tests.el (test-iso8601-date-years):
Adjust test case to match fixed behavior.
lisp/calendar/iso8601.el
test/lisp/calendar/iso8601-tests.el