From 1e896049d7436c91ad0d1e060662b5f344408986 Mon Sep 17 00:00:00 2001 From: gerd <gerd> Date: Fri, 29 Aug 2003 19:22:32 +0000 Subject: [PATCH] (ext:parse-time "Fri, 04 Apr 2003 01:36:12 0200") => 3258488172 (ext:parse-time "Fri, 04 Apr 2003 01:36:12 +0200") => nil * src/code/parse-time.lisp (decompose-string): Handle offsets from GMT with a leading +. From Miles Egan. Reported by Dan Barlow. --- code/parse-time.lisp | 12 ++++++------ general-info/release-19a.txt | 1 + 2 files changed, 7 insertions(+), 6 deletions(-) diff --git a/code/parse-time.lisp b/code/parse-time.lisp index 55bbc0655..721c7b33e 100644 --- a/code/parse-time.lisp +++ b/code/parse-time.lisp @@ -5,7 +5,7 @@ ;;; Carnegie Mellon University, and has been placed in the public domain. ;;; (ext:file-comment - "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/parse-time.lisp,v 1.10 2003/08/16 11:45:47 gerd Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/parse-time.lisp,v 1.11 2003/08/29 19:22:32 gerd Exp $") ;;; ;;; ********************************************************************** @@ -461,13 +461,13 @@ (setf numeric-value (- numeric-value))) (push numeric-value parts-list) (setf string-index scan-index)))) - ((and (char= next-char #\-) + ((and (member next-char '(#\+ #\-) :test #'char=) (or (not prev-char) (member prev-char whitespace-chars :test #'char=))) - ;; If we see a minus sign before a number, but not after one, - ;; it is not a date divider, but a negative offset from GMT, so - ;; set next-negative to t and continue. - (setf next-negative t) + ;; If we see a minus or plus sign before a number, but + ;; not after one, it is not a date divider, but a offset + ;; from GMT, so set next-negative to t if minus and continue. + (setq next-negative (char= next-char #\-)) (incf string-index)) ((member next-char time-dividers :test #'char=) ;; Time-divider - add it to the parts-list with symbol. diff --git a/general-info/release-19a.txt b/general-info/release-19a.txt index 27a97c500..3551f5b78 100644 --- a/general-info/release-19a.txt +++ b/general-info/release-19a.txt @@ -168,6 +168,7 @@ New in this release: COMPACT-INFO-LOOKUP for hash values equal to MOST-POSITIVE-FIXNUM. - FFLOOR and FCEILING return types sometimes being inferred as being the nil type. + - PARSE-TIME accepting GMT offsets with a leading plus sign. * Other changes: - CREATE-REQUEST-SERVER has an additional :reuse-address keyword -- GitLab