]> git.eshelyaron.com Git - emacs.git/commitdiff
(ls-lisp-format-time): Trap errors from
authorAndrew Innes <andrewi@gnu.org>
Sun, 2 May 1999 09:40:45 +0000 (09:40 +0000)
committerAndrew Innes <andrewi@gnu.org>
Sun, 2 May 1999 09:40:45 +0000 (09:40 +0000)
format-time-string, and return a suitable string to indicate the
timestamp was invalid.

lisp/ls-lisp.el

index a498c07321f26d6892229af0dfdbc005302589d4..f52bdef4b0a911960bc4fb34ff05233e67db02fe 100644 (file)
@@ -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)