fix: failure to load doom libs on 27.x

Emacs 27.x does not collapse consecutive slashes in a file path when
trying to load them, and instead discards everything before it and
treats the rest as an absolute path, e.g. "~/some//path/foo/" ->
"/path/foo". This is not the case in 28.1, but Doom's backport of
file-name-concat did not take this into account, so it's been modified
to trim trailing slashes.

Fix: #6766
Amend: 433c9e344d
This commit is contained in:
Henrik Lissner 2022-09-10 14:11:54 +02:00
parent eb80d461df
commit 3505e666a8
No known key found for this signature in database
GPG key ID: B60957CA074D39A3

View file

@ -857,11 +857,12 @@ with a slash -- if they don't end with a slash, a slash will be
inserted before contatenating."
(mapconcat
#'identity
(save-match-data
(cl-loop for str in (cons directory components)
when (and str (/= 0 (length str))
(string-match "\\(.+\\)/?" str))
collect (match-string 1 str)))
(cl-loop for str in (cons directory components)
if (and str (/= 0 (length str))
(if (string-suffix-p "/" str)
(substring str 0 -1)
str))
collect it)
"/"))
;; Introduced in Emacs 28.1