]> git.eshelyaron.com Git - emacs.git/commitdiff
(dired-insert-directory): If file-system-info fails,
authorEli Zaretskii <eliz@gnu.org>
Sun, 14 Jan 2001 19:16:07 +0000 (19:16 +0000)
committerEli Zaretskii <eliz@gnu.org>
Sun, 14 Jan 2001 19:16:07 +0000 (19:16 +0000)
remove the " free " part, but don't signal an error.

lisp/dired.el

index 4a9a637797cd37b496e313a59a57ddc4cc000a17..7b77ee77239979b9a28abbea1be30d9e4d373a72 100644 (file)
@@ -689,9 +689,13 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
            ;; 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