* Open Bugs
-** OPEN Relative Gemini links processed improperly
+** OPEN Sanitize certificate names
+ :LOGBOOK:
+ - State "OPEN" from [2020-06-22 Mon 10:32]
+ :END:
+
+Currently things will break in undefined ways if a name is specified
+that contains path separators and probably other characters that I
+haven't thought of. This is dangerously unacceptable and needs to be
+fixed right away.
+
+** OPEN Set timer after creating network process
+
+While the current order is necessary for synchronous socks
+connections, it is unecessary for regular connections which have the
+no-wait flag set. Furthermore, for these connections, having the
+timer fire up early means that it interferes with requests for
+user interaction that may appear during the initial connection setup.
+E.g., asking for approval of uknown TLS certificates.
+
+* Closed Bugs
+
+** CLOSED Relative Gemini links processed improperly
:LOGBOOK:
+- State "CLOSED" from "OPEN" [2021-08-04 Wed 15:54]
- State "OPEN" from [2021-08-04 Wed 13:53]
:END:
gemini://skyjake.fi/ rather than gemini://skyjake.fi.
-** OPEN Sanitize certificate names
- :LOGBOOK:
- - State "OPEN" from [2020-06-22 Mon 10:32]
- :END:
-
-Currently things will break in undefined ways if a name is specified
-that contains path separators and probably other characters that I
-haven't thought of. This is dangerously unacceptable and needs to be
-fixed right away.
-
-** OPEN Set timer after creating network process
-
-While the current order is necessary for synchronous socks
-connections, it is unecessary for regular connections which have the
-no-wait flag set. Furthermore, for these connections, having the
-timer fire up early means that it interferes with requests for
-user interaction that may appear during the initial connection setup.
-E.g., asking for approval of uknown TLS certificates.
-
-* Closed Bugs
** CLOSED Org mode faces are not present in recent emacs versions
Even 26.1 doesn't seem to have these. This means that, for many
rest))))
(defun elpher-collapse-dot-sequences (filename)
- "Collapse dot sequences in FILENAME.
-For instance, the filename /a/b/../c/./d will reduce to /a/c/d"
- (let* ((path (split-string filename "/"))
+ "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))
(path-reversed-normalized
(seq-reduce (lambda (a b)
- (cond ((and a (equal b "..") (cdr a)))
- ((and (not a) (equal b "..")) a) ;leading .. are dropped
+ (cond ((equal b "..") (cdr a))
((equal b ".") a)
(t (cons b a))))
- path nil)))
- (string-join (reverse path-reversed-normalized) "/")))
+ 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) "/") "")
+ "/")))
(defun elpher-address-from-gemini-url (url)
"Extract address from URL with defaults as per gemini map files.