From 8e2dafcf5d63dd51078a77d6535905f2f34fee59 Mon Sep 17 00:00:00 2001 From: plugd Date: Wed, 4 Aug 2021 16:37:28 +0200 Subject: [PATCH] Cleaning up. --- elpher.el | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) 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) -- 2.20.1