X-Git-Url: http://cgit.sxemacs.org/?a=blobdiff_plain;f=lisp%2Fparse-time.el;h=9c976963c011f0650b424534d2e42c6b59e182e2;hb=f7715b17774afabbadc92f15b1ee087624e587a8;hp=231c221d753d67aee9b29cb66cf0fd7f5d42413a;hpb=477d2d1e18caaf92a73dbbcbfb1e87d3c104a10a;p=gnus diff --git a/lisp/parse-time.el b/lisp/parse-time.el index 231c221d7..9c976963c 100644 --- a/lisp/parse-time.el +++ b/lisp/parse-time.el @@ -1,7 +1,6 @@ ;;; parse-time.el --- parsing time strings -;; Copyright (C) 1996, 2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, -;; 2008, 2009, 2010, 2011 Free Software Foundation, Inc. +;; Copyright (C) 1996, 2000-2012 Free Software Foundation, Inc. ;; Author: Erik Naggum ;; Keywords: util @@ -113,11 +112,11 @@ (index 0) (c nil)) (while (< index end) - (while (and (< index end) ;skip invalid characters + (while (and (< index end) ;Skip invalid characters. (not (setq c (parse-time-string-chars (aref string index))))) (incf index)) (setq start index all-digits (eq c ?0)) - (while (and (< (incf index) end) ;scan valid characters + (while (and (< (incf index) end) ;Scan valid characters. (setq c (parse-time-string-chars (aref string index)))) (setq all-digits (and all-digits (eq c ?0)))) (if (<= index end) @@ -214,28 +213,29 @@ unknown are returned as nil." (predicate (pop rule)) (parse-time-val)) (when (and (not (nth (car slots) time)) ;not already set - (setq parse-time-val (cond ((and (consp predicate) - (not (eq (car predicate) - 'lambda))) - (and (numberp parse-time-elt) - (<= (car predicate) parse-time-elt) - (<= parse-time-elt (cadr predicate)) - parse-time-elt)) - ((symbolp predicate) - (cdr (assoc parse-time-elt - (symbol-value predicate)))) - ((funcall predicate))))) + (setq parse-time-val + (cond ((and (consp predicate) + (not (eq (car predicate) + 'lambda))) + (and (numberp parse-time-elt) + (<= (car predicate) parse-time-elt) + (<= parse-time-elt (cadr predicate)) + parse-time-elt)) + ((symbolp predicate) + (cdr (assoc parse-time-elt + (symbol-value predicate)))) + ((funcall predicate))))) (setq exit t) (while slots - (let ((new-val (and rule - (let ((this (pop rule))) - (if (vectorp this) - (parse-integer - parse-time-elt - (aref this 0) (aref this 1)) - (funcall this)))))) - (rplaca (nthcdr (pop slots) time) - (or new-val parse-time-val))))))))) + (let ((new-val (if rule + (let ((this (pop rule))) + (if (vectorp this) + (parse-integer + parse-time-elt + (aref this 0) (aref this 1)) + (funcall this))) + parse-time-val))) + (rplaca (nthcdr (pop slots) time) new-val)))))))) time)) (provide 'parse-time)