changeset 35295:306adc548aaa

(dired-insert-directory): If file-system-info fails, remove the " free " part, but don't signal an error.
author Eli Zaretskii <eliz@gnu.org>
date Sun, 14 Jan 2001 19:16:07 +0000
parents e6301582e693
children 13441490c2f3
files lisp/dired.el
diffstat 1 files changed, 7 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/dired.el	Sat Jan 13 16:49:49 2001 +0000
+++ b/lisp/dired.el	Sun Jan 14 19:16:07 2001 +0000
@@ -689,9 +689,13 @@
 	    ;; Non-Posix systems don't always have dired-free-space-program,
 	    ;; but might have an equivalent system call.
 	    (if (fboundp 'file-system-info)
-		(insert
-		 (format "%.0f"
-			 (/ (nth 2 (file-system-info dir-or-list)) 1024)))
+		(let ((beg (point))
+		      (fsinfo (file-system-info dir-or-list)))
+		  (if fsinfo
+		      (insert
+		       (format "%.0f" (/ (nth 2 fsinfo) 1024)))
+		    ;; file-system-info failed; delete " free ".
+		    (delete-region (- beg 7) beg)))
 	      (let ((beg (point)))
 		(condition-case nil
 		    (if (zerop (call-process dired-free-space-program nil t nil