From: Aleksandr Vityazev Date: Thu, 11 Nov 2021 10:53:41 +0000 (+0100) Subject: Fix tramp-compat-file-name-concat (Bug#51754) X-Git-Tag: emacs-28.0.90~86 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=6dae01ad6da1bcbced062c0d46a6759c7a0570e4;p=emacs.git Fix tramp-compat-file-name-concat (Bug#51754) * lisp/net/tramp-compat.el: Make `tramp-compat-file-name-concat' work like file-name-concat. (Bug#51754) --- diff --git a/lisp/net/tramp-compat.el b/lisp/net/tramp-compat.el index 213ab5857c5..fbc3d684ce8 100644 --- a/lisp/net/tramp-compat.el +++ b/lisp/net/tramp-compat.el @@ -386,14 +386,17 @@ CONDITION can also be a list of error conditions." (if (fboundp 'file-name-concat) #'file-name-concat (lambda (directory &rest components) - (unless (null directory) - (let ((components (delq nil components)) - file-name-handler-alist) - (if (null components) - directory - (tramp-compat-file-name-concat - (concat (file-name-as-directory directory) (car components)) - (cdr components)))))))) + (let ((components (cl-remove-if (lambda (el) + (or (null el) (equal "" el))) + components)) + file-name-handler-alist) + (if (null components) + directory + (apply #'tramp-compat-file-name-concat + (concat (unless (or (equal "" directory) (null directory)) + (file-name-as-directory directory)) + (car components)) + (cdr components))))))) (dolist (elt (all-completions "tramp-compat-" obarray 'functionp)) (put (intern elt) 'tramp-suppress-trace t))