1
Fork 0
mirror of https://git.savannah.gnu.org/git/guile.git synced 2025-05-20 11:40:18 +02:00
guile/module/srfi
Mark H Weaver a58c7abd72 SRFI-19: Fix handling of negative years and negative julian days.
Fixes <https://bugs.gnu.org/21906>.
Mitigates <https://bugs.gnu.org/21903> and <https://bugs.gnu.org/21904>.
Reported by: Zefram <zefram@fysh.org>.

* module/srfi/srfi-19.scm (encode-julian-day-number)
(decode-julian-day-number, date-week-number): Use 'floor-quotient'
instead of 'quotient', and 'floor' instead of 'truncate', where
appropriate.
(time-utc->date): Ensure that the 'nanoseconds' field of the returned
date is non-negative.
(leap-year): Handle negative years properly, and reformulate the
computation.
(week-day): Handle negative years properly.  Use 'floor-quotient'
instead of 'quotient' where appropriate.
(directives): In the handler for '~Y' format escapes, improve the
handling of years outside of the range 0-9999.
(read-directives): Add a FIXME comment to fix the '~Y' reader to handle
years outside of the range 0-9999.
* test-suite/tests/srfi-19.test: Import (srfi srfi-1).  Use Guile's
modern keyword notation in the 'define-module' form.  Add more tests.
2018-10-20 23:15:51 -04:00
..
srfi-4 (srfi srfi-4 gnu) uses private define-bytevector-type from (srfi srfi-4) 2014-02-07 18:00:04 +01:00
srfi-9 doc: Fix typo in `set-record-type-printer!' doc. 2012-11-17 15:34:49 +01:00
srfi-42 Add implementation of SRFI 42 2010-10-03 12:09:50 +02:00
srfi-64 Implement SRFI-64 - A Scheme API for test suites. 2014-02-01 01:19:55 -05:00
srfi-67 fix srfi-67 compilation 2011-09-02 19:49:26 +02:00
srfi-1.scm Rewrite boot-9 map to be recursive and pure 2014-05-01 21:17:28 +02:00
srfi-2.scm Complete changing license to LGPLv3+ 2009-06-17 22:30:26 +01:00
srfi-4.scm Remove private unused duplicate c32/c64vector definitions 2014-02-07 17:57:30 +01:00
srfi-6.scm String ports use UTF-8; ignore %default-port-encoding. 2013-08-07 01:22:22 -04:00
srfi-8.scm Complete changing license to LGPLv3+ 2009-06-17 22:30:26 +01:00
srfi-9.scm Match and srfi-9 expose their bailouts to the CSE pass 2014-04-05 11:56:44 +02:00
srfi-10.scm Complete changing license to LGPLv3+ 2009-06-17 22:30:26 +01:00
srfi-11.scm actually inline call-with-values to tree-il's <let-values> 2009-08-06 11:48:16 +02:00
srfi-13.scm Complete changing license to LGPLv3+ 2009-06-17 22:30:26 +01:00
srfi-14.scm Complete changing license to LGPLv3+ 2009-06-17 22:30:26 +01:00
srfi-16.scm Add srfi-16 and srfi-30 to %cond-expand-features. 2014-01-14 02:19:52 -05:00
srfi-17.scm Complete changing license to LGPLv3+ 2009-06-17 22:30:26 +01:00
srfi-18.scm srfi-18: 'thread-sleep!' timeout-as-a-number is relative. 2018-02-16 15:29:35 +01:00
srfi-19.scm SRFI-19: Fix handling of negative years and negative julian days. 2018-10-20 23:15:51 -04:00
srfi-26.scm Get rid of `define-macro' in the SRFI 26 implementation 2010-12-07 23:13:55 +01:00
srfi-27.scm Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list. 2013-03-21 12:50:04 -04:00
srfi-28.scm Implement SRFI 28: Basic Format Strings. 2014-12-02 11:49:05 -05:00
srfi-31.scm Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list. 2013-03-21 12:50:04 -04:00
srfi-34.scm Fix srfi-34 indentation 2016-10-30 20:31:57 +01:00
srfi-35.scm Use make-struct/no-tail instead of make-struct 2017-09-20 22:07:18 +02:00
srfi-37.scm SRFI-37: Account for zero-length arguments. 2017-04-20 10:58:54 +02:00
srfi-38.scm Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list. 2013-03-21 12:50:04 -04:00
srfi-39.scm Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list. 2013-03-21 12:50:04 -04:00
srfi-41.scm Add record type printer for srfi-41. 2013-04-07 12:44:31 -04:00
srfi-42.scm Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list. 2013-03-21 12:50:04 -04:00
srfi-43.scm doc: Improve description of vector-unfold and vector-unfold-right. 2014-09-24 22:03:58 -04:00
srfi-45.scm Add record type printer for srfi-45. 2013-04-07 12:43:17 -04:00
srfi-60.scm move srfi-1 and srfi-60 C impl to libguile, without public C api 2010-09-12 23:29:11 +02:00
srfi-64.scm Implement SRFI-64 - A Scheme API for test suites. 2014-02-01 01:19:55 -05:00
srfi-67.scm Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list. 2013-03-21 12:50:04 -04:00
srfi-69.scm Add missing 'cond-expand' feature identifiers; remove srfi-6 from core list. 2013-03-21 12:50:04 -04:00
srfi-71.scm Make srfi-71 visible through 'cond-expand'. 2018-07-04 20:42:07 -04:00
srfi-88.scm Improve correctness and consistency of 'eval-when' usage. 2014-01-23 10:41:22 -05:00
srfi-98.scm Complete changing license to LGPLv3+ 2009-06-17 22:30:26 +01:00
srfi-111.scm Implement SRFI-111 Boxes. 2014-01-24 10:50:51 -05:00