From 793516d8b93a00ea328a9272f586c1881cf1587b Mon Sep 17 00:00:00 2001 From: rtoy <rtoy> Date: Wed, 4 Jan 2006 21:54:21 +0000 Subject: [PATCH] Fix bug in parsing times. Things like "Tue Sep 7 18:56:57 UTC 2004" were not parsed correctly because the "T" in Tue was being treated as a date-time-divider. Don't allow a date-time-divider to be at the start of the string. --- code/parse-time.lisp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/code/parse-time.lisp b/code/parse-time.lisp index 41b98f51d..6dd7b7a96 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.13 2005/06/01 12:08:36 rtoy Exp $") + "$Header: /Volumes/share2/src/cmucl/cvs2git/cvsroot/src/code/parse-time.lisp,v 1.14 2006/01/04 21:54:21 rtoy Exp $") ;;; ;;; ********************************************************************** @@ -447,7 +447,9 @@ (prev-char (if (= string-index start) nil (char string (1- string-index))))) - (cond ((member next-char date-time-dividers :test #'char=) + (cond ((and (/= string-index start) + (member next-char date-time-dividers :test #'char=)) + ;; A date-time-divider can't be at the start of the string. (push (cons 'date-time-divider next-char) parts-list) (incf string-index)) ((alpha-char-p next-char) -- GitLab