[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[elpa] externals/disk-usage 63a3ca8 1/2: Fall back on 0 in -directory-si
From: |
Pierre Neidhardt |
Subject: |
[elpa] externals/disk-usage 63a3ca8 1/2: Fall back on 0 in -directory-size-with-du |
Date: |
Tue, 26 Mar 2019 07:08:21 -0400 (EDT) |
branch: externals/disk-usage
commit 63a3ca8707c330589f8f66bf758c56e1e18cfdca
Author: Pierre Neidhardt <address@hidden>
Commit: Pierre Neidhardt <address@hidden>
Fall back on 0 in -directory-size-with-du
---
disk-usage.el | 19 ++++++++++---------
1 file changed, 10 insertions(+), 9 deletions(-)
diff --git a/disk-usage.el b/disk-usage.el
index ae60280..bc49287 100644
--- a/disk-usage.el
+++ b/disk-usage.el
@@ -360,15 +360,16 @@ This is slow but does not require any external process."
(defun disk-usage-directory-size-with-du (path)
"See `disk-usage-directory-size-function'."
- (string-to-number
- (cl-first
- (split-string
- (with-temp-buffer
- (with-output-to-string
- (process-file disk-usage-du-command
- nil '(t nil) nil
- disk-usage-du-args (file-local-name path)))
- (buffer-string))))))
+ (or (ignore-errors (string-to-number
+ (cl-first
+ (split-string
+ (with-temp-buffer
+ (with-output-to-string
+ (process-file disk-usage-du-command
+ nil '(t nil) nil
+ disk-usage-du-args (file-local-name
path)))
+ (buffer-string))))))
+ 0))
(defalias 'disk-usage--directory-size-with-du
'disk-usage-directory-size-with-du)
(defun disk-usage--sort-by-size (a b)