mirror of https://github.com/djcb/mu.git
Preserve single and double slashes while joining
This commit is contained in:
parent
a71b4f5e8d
commit
e4ac3f205d
|
@ -572,10 +572,14 @@ Or go to the top level if there is none."
|
|||
This is mu4e's version of Emacs 28's `file-name-concat' with the
|
||||
difference it also handles slashes at the beginning of
|
||||
COMPONENTS."
|
||||
(replace-regexp-in-string
|
||||
(let ((double-slash (string-match "^//[^/]" directory))
|
||||
(path (replace-regexp-in-string
|
||||
"//+" "/"
|
||||
(mapconcat (lambda (part) (if (stringp part) part ""))
|
||||
(cons directory components) "/")))
|
||||
(cons directory components) "/"))))
|
||||
(if double-slash
|
||||
(concat "/" path)
|
||||
path)))
|
||||
|
||||
(defun mu4e-string-replace (from-string to-string in-string)
|
||||
"Replace FROM-STRING with TO-STRING in IN-STRING each time it occurs.
|
||||
|
|
Loading…
Reference in New Issue