X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;h=11ca3c171064cf2946f762e39a33977d8b523b4f;hp=bd9cbb56cbf1f304b1fba56a5f4a5f962e8a6e19;hb=8e2dafcf5d63dd51078a77d6535905f2f34fee59;hpb=88f19dc9704f8e44316715b31c12154be7c1deaa diff --git a/elpher.el b/elpher.el index bd9cbb5..11ca3c1 100644 --- a/elpher.el +++ b/elpher.el @@ -1432,6 +1432,7 @@ Returns the url portion in the event that the display-string portion is empty." "Collapse dot sequences in the (absolute) FILENAME. For instance, the filename \"/a/b/../c/./d\" will reduce to \"/a/c/d\"" (let* ((path (split-string filename "/" t)) + (is-directory (string-match-p (rx (: (or "." ".." "/") line-end)) filename)) (path-reversed-normalized (seq-reduce (lambda (a b) (cond ((equal b "..") (cdr a)) @@ -1440,10 +1441,7 @@ For instance, the filename \"/a/b/../c/./d\" will reduce to \"/a/c/d\"" path nil)) (path-normalized (reverse path-reversed-normalized))) (if path-normalized - (concat - "/" - (string-join (reverse path-reversed-normalized) "/") - (if (string-match-p (rx (: (or "." ".." "/") line-end)) filename) "/") "") + (concat "/" (string-join path-normalized "/") (and is-directory "/")) "/"))) (defun elpher-address-from-gemini-url (url)