From: Lars Ingebrigtsen Date: Thu, 13 Aug 2020 10:01:01 +0000 (+0200) Subject: Ensure that server-socket-dir doesn't have "//" in the path X-Git-Tag: emacs-28.0.90~6611 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=e9eafd22681b8e95d8d642def0512d9290564206;p=emacs.git Ensure that server-socket-dir doesn't have "//" in the path * lisp/server.el (server-socket-dir): Use expand-file-name to avoid "//" in the path name (if either XDG_RUNTIME_DIR or TMPDIR ends in a slash) (bug#18658). --- diff --git a/lisp/server.el b/lisp/server.el index 18612181477..9934e1c1be9 100644 --- a/lisp/server.el +++ b/lisp/server.el @@ -274,10 +274,11 @@ the \"-f\" switch otherwise." (if internal--daemon-sockname (file-name-directory internal--daemon-sockname) (and (featurep 'make-network-process '(:family local)) - (let ((xdg_runtime_dir (getenv "XDG_RUNTIME_DIR"))) - (if xdg_runtime_dir - (format "%s/emacs" xdg_runtime_dir) - (format "%s/emacs%d" (or (getenv "TMPDIR") "/tmp") (user-uid)))))) + (let ((runtime-dir (getenv "XDG_RUNTIME_DIR"))) + (if runtime-dir + (expand-file-name "emacs" runtime-dir) + (expand-file-name (format "emacs%d" (user-uid)) + (or (getenv "TMPDIR") "/tmp")))))) "The directory in which to place the server socket. If local sockets are not supported, this is nil.")