summaryrefslogtreecommitdiff
path: root/lisp/timezone.el
diff options
context:
space:
mode:
authorRichard M. Stallman <rms@gnu.org>1995-07-07 13:25:47 +0000
committerRichard M. Stallman <rms@gnu.org>1995-07-07 13:25:47 +0000
commitf457383941d94c22eca32d89a0b7934c09ee13d3 (patch)
treefcaa4b2df41a167ec5f979c91e3b8b12cba9506d /lisp/timezone.el
parente11a39dfe9deef46bc4fe3fc8103dd27a3dbf1e4 (diff)
downloademacs-f457383941d94c22eca32d89a0b7934c09ee13d3.tar.gz
(timezone-parse-date): Ignore text properties.
Diffstat (limited to 'lisp/timezone.el')
-rw-r--r--lisp/timezone.el24
1 files changed, 13 insertions, 11 deletions
diff --git a/lisp/timezone.el b/lisp/timezone.el
index 5e0fd7f105b..58d9faa6639 100644
--- a/lisp/timezone.el
+++ b/lisp/timezone.el
@@ -130,6 +130,12 @@ Understands the following styles:
(5) 22-AUG-1993 10:59:12.82
(6) Thu, 11 Apr 16:17:12 91 [MET]
(7) Mon, 6 Jul 16:47:20 T 1992 [MET]"
+ ;; Get rid of any text properties.
+ (and (stringp date)
+ (or (text-properties-at 0 date)
+ (next-property-change 0 date))
+ (setq date (copy-sequence date))
+ (set-text-properties 0 (length date) nil date))
(let ((date (or date ""))
(year nil)
(month nil)
@@ -176,17 +182,13 @@ Understands the following styles:
;; It is now Dec 1992. 8 years before the end of the World.
(if (< (length year) 4)
(setq year (concat "19" (substring year -2 nil))))
- (setq month
- (int-to-string
- (cdr
- (assoc
- (upcase
- ;; Don't use `match-end' in order to take 3
- ;; letters from the beginning.
- (substring date
- (match-beginning month)
- (+ (match-beginning month) 3)))
- timezone-months-assoc))))
+ (let ((string (substring date
+ (match-beginning month)
+ (+ (match-beginning month) 3))))
+ (setq month
+ (int-to-string
+ (cdr (assoc (upcase string) timezone-months-assoc)))))
+
(setq day
(substring date (match-beginning day) (match-end day)))
(setq time