X-Git-Url: https://thelambdalab.xyz/gitweb/index.cgi?p=elpher.git;a=blobdiff_plain;f=elpher.el;fp=elpher.el;h=4a98cb3c86e6ece12fb62d4dc74e28d390d5f770;hp=608f09d28ec61965b65d40f89a4dc499dc465e96;hb=22d2f81e6b829690463139a22ddd729019f23c95;hpb=81f2883614c303184116449ec3583ef5c136ec2f diff --git a/elpher.el b/elpher.el index 608f09d..4a98cb3 100644 --- a/elpher.el +++ b/elpher.el @@ -1607,12 +1607,18 @@ treatment that a separate function is warranted." (if (string-empty-p (url-filename address)) (setf (url-filename address) "/")) ;ensure empty filename is marked as absolute (setf (url-host address) (url-host current-address)) - (setf (url-fullness address) (url-host address)) ; set fullness to t if host is set - (setf (url-portspec address) (url-portspec current-address)) ; (url-port) too slow! - (unless (string-prefix-p "/" (url-filename address)) ;deal with relative links + (setf (url-fullness address) (url-host address)) ;set fullness to t if host is set + (setf (url-portspec address) (url-portspec current-address)) ;(url-port) too slow! + (cond + ((string-prefix-p "/" (url-filename address))) ;do nothing for absolute case + ((string-prefix-p "?" (url-filename address)) ;handle query-only links + (setf (url-filename address) + (concat (url-filename current-address) + (url-filename address)))) + (t ;deal with relative links (setf (url-filename address) (concat (file-name-directory (url-filename current-address)) - (url-filename address))))) + (url-filename address)))))) (when (url-host address) (setf (url-host address) (puny-encode-domain (url-host address)))) (unless (url-type address)