emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master e9eafd2: Ensure that server-socket-dir doesn't have "//" in the p


From: Lars Ingebrigtsen
Subject: master e9eafd2: Ensure that server-socket-dir doesn't have "//" in the path
Date: Thu, 13 Aug 2020 06:01:10 -0400 (EDT)

branch: master
commit e9eafd22681b8e95d8d642def0512d9290564206
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    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).
---
 lisp/server.el | 9 +++++----
 1 file changed, 5 insertions(+), 4 deletions(-)

diff --git a/lisp/server.el b/lisp/server.el
index 1861218..9934e1c 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.")
 



reply via email to

[Prev in Thread] Current Thread [Next in Thread]