From: Chris Hanson Date: Sun, 26 Oct 2008 20:14:34 +0000 (+0000) Subject: On input, allow any combination of ISO 8601 basic and extended X-Git-Tag: 20090517-FFI~95 X-Git-Url: https://birchwood-abbey.net/git?a=commitdiff_plain;h=4a85383c88a067f656057b7070bd82d3fba5cdc3;p=mit-scheme.git On input, allow any combination of ISO 8601 basic and extended formats. This compensates for broken xml-rpc "spec". --- diff --git a/v7/src/runtime/datime.scm b/v7/src/runtime/datime.scm index 8e6c7c4e2..23ab380a1 100644 --- a/v7/src/runtime/datime.scm +++ b/v7/src/runtime/datime.scm @@ -1,6 +1,6 @@ #| -*-Scheme-*- -$Id: datime.scm,v 14.55 2008/09/24 08:50:48 cph Exp $ +$Id: datime.scm,v 14.56 2008/10/26 20:14:34 cph Exp $ Copyright (C) 1986, 1987, 1988, 1989, 1990, 1991, 1992, 1993, 1994, 1995, 1996, 1997, 1998, 1999, 2000, 2001, 2002, 2003, 2004, 2005, @@ -580,18 +580,18 @@ USA. (decoded-time->file-time (iso8601-string->decoded-time string))) (define parser:iso8601-date/time - ;; Use of the space separator isn't allowed, but we used to - ;; generate strings with it, so don't barf if we see it. + ;; The ISO spec says that a date/time must be either entirely in + ;; basic format or entirely in extended format. But the XML-RPC + ;; "spec" has usage that's a mix between the formats. Hence we + ;; accept any combination of the two formats. Use of the space + ;; separator isn't allowed, but we used to generate strings with it, + ;; so don't barf if we see it. (*parser (encapsulate convert-8601-date/time - (alt (seq parse-basic-8601-date - (alt "T" " ") - parse-basic-8601-time - parse-basic-8601-zone) - (seq parse-extended-8601-date - (alt "T" " ") - parse-extended-8601-time - parse-extended-8601-zone))))) + (seq (alt parse-basic-8601-date parse-extended-8601-date) + (alt "T" " ") + (alt parse-basic-8601-time parse-extended-8601-time) + (alt parse-basic-8601-zone parse-extended-8601-zone))))) (define (convert-8601-date/time v) (let ((year (vector-ref v 0))