]> git.eshelyaron.com Git - emacs.git/commitdiff
Fix tramp-compat-file-name-concat (Bug#51754)
authorAleksandr Vityazev <avityazev@posteo.org>
Thu, 11 Nov 2021 10:53:41 +0000 (11:53 +0100)
committerMichael Albinus <michael.albinus@gmx.de>
Thu, 11 Nov 2021 10:53:41 +0000 (11:53 +0100)
* lisp/net/tramp-compat.el: Make `tramp-compat-file-name-concat'
work like file-name-concat.  (Bug#51754)

lisp/net/tramp-compat.el

index 213ab5857c5f99e8f790c93ee6a9e50736cc30dc..fbc3d684ce80c5d5501fab1c763f8ec84b574761 100644 (file)
@@ -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))