diff options
author | Andrew Innes <andrewi@gnu.org> | 1999-05-02 09:40:45 +0000 |
---|---|---|
committer | Andrew Innes <andrewi@gnu.org> | 1999-05-02 09:40:45 +0000 |
commit | f8a1023408264cfdec0b568b7d14084f4f60abfd (patch) | |
tree | be4d30a18d50332b4ca507a95e9e42970f454f6f /lisp/ls-lisp.el | |
parent | 7e3a77161ef2c49d8cd74f82066095cfade73ee9 (diff) | |
download | emacs-f8a1023408264cfdec0b568b7d14084f4f60abfd.tar.gz |
(ls-lisp-format-time): Trap errors from
format-time-string, and return a suitable string to indicate the
timestamp was invalid.
Diffstat (limited to 'lisp/ls-lisp.el')
-rw-r--r-- | lisp/ls-lisp.el | 20 |
1 files changed, 11 insertions, 9 deletions
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) |