[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
master 3cc06d1 1/2: * lisp/net/tramp.el (tramp-handle-file-regular-p): I
From: |
Michael Albinus |
Subject: |
master 3cc06d1 1/2: * lisp/net/tramp.el (tramp-handle-file-regular-p): Improve error handling. |
Date: |
Tue, 19 Nov 2019 02:20:03 -0500 (EST) |
branch: master
commit 3cc06d1abb6587e0922a5ddc7a7febd3dd71d55a
Author: Michael Albinus <address@hidden>
Commit: Michael Albinus <address@hidden>
* lisp/net/tramp.el (tramp-handle-file-regular-p): Improve error handling.
---
lisp/net/tramp.el | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el
index 99c93ea..cb40c71 100644
--- a/lisp/net/tramp.el
+++ b/lisp/net/tramp.el
@@ -3306,9 +3306,13 @@ User is always nil."
(defun tramp-handle-file-regular-p (filename)
"Like `file-regular-p' for Tramp files."
(and (file-exists-p filename)
- (eq ?-
- (aref (tramp-compat-file-attribute-modes (file-attributes filename))
- 0))))
+ ;; Sometimes, `file-attributes' does not return a proper value
+ ;; even if `file-exists-p' does.
+ (ignore-errors
+ (eq ?-
+ (aref
+ (tramp-compat-file-attribute-modes (file-attributes filename))
+ 0)))))
(defun tramp-handle-file-remote-p (filename &optional identification connected)
"Like `file-remote-p' for Tramp files."
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- master 3cc06d1 1/2: * lisp/net/tramp.el (tramp-handle-file-regular-p): Improve error handling.,
Michael Albinus <=