summaryrefslogtreecommitdiff
path: root/lisp/net/tramp-gvfs.el
diff options
context:
space:
mode:
authorMichael Albinus <michael.albinus@gmx.de>2019-03-06 12:06:09 +0100
committerMichael Albinus <michael.albinus@gmx.de>2019-03-06 12:06:09 +0100
commitbe147d24198479bd569e71603c1d80f579311872 (patch)
tree73669a8f973c8ccb092a4be3f6da43890d581a14 /lisp/net/tramp-gvfs.el
parenta3be45ddf43da73ce91731cfd4792abf14596637 (diff)
downloademacs-be147d24198479bd569e71603c1d80f579311872.tar.gz
Handle empty strings in Tramp's expand-file-name implementations
* lisp/net/tramp.el (tramp-handle-expand-file-name): * lisp/net/tramp-gvfs.el (tramp-gvfs-handle-expand-file-name): * lisp/net/tramp-sh.el (tramp-sh-handle-expand-file-name): * lisp/net/tramp-smb.el (tramp-smb-handle-expand-file-name): * lisp/net/tramp-sudoedit.el (tramp-sudoedit-handle-expand-file-name): Handle empty NAME. * test/lisp/net/tramp-tests.el (tramp-test01-file-name-syntax) (tramp-test01-file-name-syntax-simplified) (tramp-test01-file-name-syntax-separate): Use neutral IPv4 address. (tramp-test05-expand-file-name): Check also "." and "".
Diffstat (limited to 'lisp/net/tramp-gvfs.el')
-rw-r--r--lisp/net/tramp-gvfs.el2
1 files changed, 2 insertions, 0 deletions
diff --git a/lisp/net/tramp-gvfs.el b/lisp/net/tramp-gvfs.el
index 569fdb55615..2d8f42004a8 100644
--- a/lisp/net/tramp-gvfs.el
+++ b/lisp/net/tramp-gvfs.el
@@ -883,6 +883,8 @@ file names."
"Like `expand-file-name' for Tramp files."
;; If DIR is not given, use DEFAULT-DIRECTORY or "/".
(setq dir (or dir default-directory "/"))
+ ;; Handle empty NAME.
+ (when (zerop (length name)) (setq name "."))
;; Unless NAME is absolute, concat DIR and NAME.
(unless (file-name-absolute-p name)
(setq name (concat (file-name-as-directory dir) name)))