changeset 104309:d38c249bcfee

* calendar/parse-time.el (parse-time-string-chars): Save match data.
author Chong Yidong <cyd@stupidchicken.com>
date Sun, 16 Aug 2009 18:38:15 +0000
parents 7cd53bf321fb
children 2ecd57cadf51
files lisp/ChangeLog lisp/calendar/parse-time.el
diffstat 2 files changed, 13 insertions(+), 7 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ChangeLog	Sun Aug 16 17:49:54 2009 +0000
+++ b/lisp/ChangeLog	Sun Aug 16 18:38:15 2009 +0000
@@ -1,3 +1,8 @@
+2009-08-16  Chong Yidong  <cyd@stupidchicken.com>
+
+	* calendar/parse-time.el (parse-time-string-chars): Save match
+	data.
+
 2009-08-16  Stefan Monnier  <monnier@iro.umontreal.ca>
 
 	* progmodes/sql.el (sql-product-alist): Add :name tag to entries.
--- a/lisp/calendar/parse-time.el	Sun Aug 16 17:49:54 2009 +0000
+++ b/lisp/calendar/parse-time.el	Sun Aug 16 18:38:15 2009 +0000
@@ -51,13 +51,14 @@
   (aref parse-time-digits char))
 
 (defsubst parse-time-string-chars (char)
-  (let (case-fold-search str)
-    (cond ((eq char ?+) 1)
-	  ((eq char ?-) -1)
-	  ((eq char ?:) ?d)
-	  ((string-match "[[:upper:]]" (setq str (string char))) ?A)
-	  ((string-match "[[:lower:]]" str) ?a)
-	  ((string-match "[[:digit:]]" str) ?0))))
+  (save-match-data
+    (let (case-fold-search str)
+      (cond ((eq char ?+) 1)
+	    ((eq char ?-) -1)
+	    ((eq char ?:) ?d)
+	    ((string-match "[[:upper:]]" (setq str (string char))) ?A)
+	    ((string-match "[[:lower:]]" str) ?a)
+	    ((string-match "[[:digit:]]" str) ?0)))))
 
 (put 'parse-error 'error-conditions '(parse-error error))
 (put 'parse-error 'error-message "Parsing error")