summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2018-02-22 11:49:07 +0100
committerMichael Albinus <michael.albinus@gmx.de>2018-02-22 11:49:07 +0100
commit130c1b8e0e94e7f309db54e440a73cb15a2c8ab6 (patch)
tree80a57710d977d65b0fbb2d38d8898a5df403f2b0
parent041c8c4c5d451a6bc6db73419fd5ffca3d09231f (diff)
downloademacs-130c1b8e0e94e7f309db54e440a73cb15a2c8ab6.tar.gz
emacs-130c1b8e0e94e7f309db54e440a73cb15a2c8ab6.tar.bz2
emacs-130c1b8e0e94e7f309db54e440a73cb15a2c8ab6.zip
Fix Bug#30533
* lisp/net/ange-ftp.el (ange-ftp-file-regular-p) (ange-ftp-real-file-regular-p): New defuns. (Bug#30533)
-rw-r--r--lisp/net/ange-ftp.el10
1 files changed, 10 insertions, 0 deletions
diff --git a/lisp/net/ange-ftp.el b/lisp/net/ange-ftp.el
index f5a5474e889..b1e0bf24aa8 100644
--- a/lisp/net/ange-ftp.el
+++ b/lisp/net/ange-ftp.el
@@ -3373,6 +3373,13 @@ system TYPE.")
(file-error nil))
(ange-ftp-real-file-symlink-p file)))
+(defun ange-ftp-file-regular-p (file)
+ ;; Reuse Tramp's implementation.
+ (if (ange-ftp-ftp-name file)
+ (and (file-exists-p file)
+ (eq ?- (aref (file-attribute-modes (file-attributes file)) 0)))
+ (ange-ftp-real-file-regular-p file)))
+
(defun ange-ftp-file-exists-p (name)
(setq name (expand-file-name name))
(if (ange-ftp-ftp-name name)
@@ -4395,6 +4402,7 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
(put 'file-readable-p 'ange-ftp 'ange-ftp-file-readable-p)
(put 'file-executable-p 'ange-ftp 'ange-ftp-file-executable-p)
(put 'file-symlink-p 'ange-ftp 'ange-ftp-file-symlink-p)
+(put 'file-regular-p 'ange-ftp 'ange-ftp-file-regular-p)
(put 'delete-file 'ange-ftp 'ange-ftp-delete-file)
(put 'verify-visited-file-modtime 'ange-ftp
'ange-ftp-verify-visited-file-modtime)
@@ -4485,6 +4493,8 @@ NEWNAME should be the name to give the new compressed or uncompressed file.")
(ange-ftp-run-real-handler 'file-executable-p args))
(defun ange-ftp-real-file-symlink-p (&rest args)
(ange-ftp-run-real-handler 'file-symlink-p args))
+(defun ange-ftp-real-file-regular-p (&rest args)
+ (ange-ftp-run-real-handler 'file-regular-p args))
(defun ange-ftp-real-delete-file (&rest args)
(ange-ftp-run-real-handler 'delete-file args))
(defun ange-ftp-real-verify-visited-file-modtime (&rest args)