From: Andrew Innes Date: Sun, 2 May 1999 09:40:45 +0000 (+0000) Subject: (ls-lisp-format-time): Trap errors from X-Git-Tag: emacs-20.4~289 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=f8a1023408264cfdec0b568b7d14084f4f60abfd;p=emacs.git (ls-lisp-format-time): Trap errors from format-time-string, and return a suitable string to indicate the timestamp was invalid. --- diff --git a/lisp/ls-lisp.el b/lisp/ls-lisp.el index a498c07321f..f52bdef4b0a 100644 --- a/lisp/ls-lisp.el +++ b/lisp/ls-lisp.el @@ -302,15 +302,17 @@ are: A a c i r S s t u" (diff (+ (ash diff16 16) (- (car (cdr time)) (car (cdr now))))) (past-cutoff (- (* 6 30 24 60 60))) ; 6 30-day months (future-cutoff (* 60 60))) ; 1 hour - (format-time-string - (if (and - (<= past-cutoff diff) (<= diff future-cutoff) - ;; Sanity check in case `diff' computation overflowed. - (<= (1- (ash past-cutoff -16)) diff16) - (<= diff16 (1+ (ash future-cutoff -16)))) - "%b %e %H:%M" - "%b %e %Y") - time))) + (condition-case nil + (format-time-string + (if (and + (<= past-cutoff diff) (<= diff future-cutoff) + ;; Sanity check in case `diff' computation overflowed. + (<= (1- (ash past-cutoff -16)) diff16) + (<= diff16 (1+ (ash future-cutoff -16)))) + "%b %e %H:%M" + "%b %e %Y") + time) + (error "??? ?? ????")))) (provide 'ls-lisp)