summaryrefslogtreecommitdiff
path: root/lisp/dired.el
diff options
context:
space:
mode:
Diffstat (limited to 'lisp/dired.el')
-rw-r--r--lisp/dired.el32
1 files changed, 17 insertions, 15 deletions
diff --git a/lisp/dired.el b/lisp/dired.el
index 5308cdb7e1a..795ca3c3005 100644
--- a/lisp/dired.el
+++ b/lisp/dired.el
@@ -687,21 +687,23 @@ If DIRNAME is already in a dired buffer, that buffer is used without refresh."
(when (re-search-forward "total [0-9]+$" nil t)
(insert " free ")
(let ((beg (point)))
- (if (zerop (call-process dired-free-space-program nil t nil
- dired-free-space-args
- (expand-file-name dir-or-list)))
- (progn
- (goto-char beg)
- (forward-line 1)
- (skip-chars-forward "^ \t")
- (forward-word 2)
- (skip-chars-forward " \t")
- (delete-region beg (point))
- (forward-word 1)
- (delete-region (point)
- (progn (forward-line 1) (point))))
- ;; The dired-free-space-program failed; delete its output
- (delete-region (- beg 7) (point))))))))
+ (condition-case nil
+ (if (zerop (call-process dired-free-space-program nil t nil
+ dired-free-space-args
+ (expand-file-name dir-or-list)))
+ (progn
+ (goto-char beg)
+ (forward-line 1)
+ (skip-chars-forward "^ \t")
+ (forward-word 2)
+ (skip-chars-forward " \t")
+ (delete-region beg (point))
+ (forward-word 1)
+ (delete-region (point)
+ (progn (forward-line 1) (point))))
+ ;; The dired-free-space-program failed; delete its output
+ (delete-region (- beg 7) (point)))
+ (error (delete-region (- beg 7) (point)))))))))
;; Quote certain characters, unless ls quoted them for us.
(if (not (string-match "b" dired-actual-switches))
(save-excursion