From: plugd Date: Wed, 4 Aug 2021 14:37:28 +0000 (+0200) Subject: Cleaning up. X-Git-Tag: v3.3.0~23 X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?a=commitdiff_plain;h=8e2dafcf5d63dd51078a77d6535905f2f34fee59;p=elpher.git Cleaning up. --- 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)