diff options
| author | Michael Albinus | 2019-11-18 15:33:21 +0100 |
|---|---|---|
| committer | Michael Albinus | 2019-11-18 15:33:21 +0100 |
| commit | 3cc06d1abb6587e0922a5ddc7a7febd3dd71d55a (patch) | |
| tree | fdd22fa3627c652518268c62104b966b99bdd52b | |
| parent | 2e92f176a3ae68ed6fcf9f07c173c61a497f33fd (diff) | |
| download | emacs-3cc06d1abb6587e0922a5ddc7a7febd3dd71d55a.tar.gz emacs-3cc06d1abb6587e0922a5ddc7a7febd3dd71d55a.zip | |
* lisp/net/tramp.el (tramp-handle-file-regular-p): Improve error handling.
| -rw-r--r-- | lisp/net/tramp.el | 10 |
1 files changed, 7 insertions, 3 deletions
diff --git a/lisp/net/tramp.el b/lisp/net/tramp.el index 99c93eaa573..cb40c71cfeb 100644 --- a/lisp/net/tramp.el +++ b/lisp/net/tramp.el | |||
| @@ -3306,9 +3306,13 @@ User is always nil." | |||
| 3306 | (defun tramp-handle-file-regular-p (filename) | 3306 | (defun tramp-handle-file-regular-p (filename) |
| 3307 | "Like `file-regular-p' for Tramp files." | 3307 | "Like `file-regular-p' for Tramp files." |
| 3308 | (and (file-exists-p filename) | 3308 | (and (file-exists-p filename) |
| 3309 | (eq ?- | 3309 | ;; Sometimes, `file-attributes' does not return a proper value |
| 3310 | (aref (tramp-compat-file-attribute-modes (file-attributes filename)) | 3310 | ;; even if `file-exists-p' does. |
| 3311 | 0)))) | 3311 | (ignore-errors |
| 3312 | (eq ?- | ||
| 3313 | (aref | ||
| 3314 | (tramp-compat-file-attribute-modes (file-attributes filename)) | ||
| 3315 | 0))))) | ||
| 3312 | 3316 | ||
| 3313 | (defun tramp-handle-file-remote-p (filename &optional identification connected) | 3317 | (defun tramp-handle-file-remote-p (filename &optional identification connected) |
| 3314 | "Like `file-remote-p' for Tramp files." | 3318 | "Like `file-remote-p' for Tramp files." |