changeset 24660:809c3c8f6b77

(ls-lisp-format-time): Trap errors from format-time-string, and return a suitable string to indicate the timestamp was invalid.
author Andrew Innes <andrewi@gnu.org>
date Sun, 02 May 1999 09:40:45 +0000
parents 991a19a97565
children a969304198eb
files lisp/ls-lisp.el
diffstat 1 files changed, 11 insertions(+), 9 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/ls-lisp.el	Sun May 02 09:38:50 1999 +0000
+++ b/lisp/ls-lisp.el	Sun May 02 09:40:45 1999 +0000
@@ -302,15 +302,17 @@
 	 (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)