Subject: Re: bug#18310: 24.3.93; relative links don't work in eww and Windows 7

From: [email-masked] (João Távora)
Date: Mon, 25 Aug 2014 18:23:11 +0100

Eli Zaretskii <[email-masked]> writes:

>> PS: Had a look at `url-expand-file-name': isn't it doing to much for
>> `shr-expand-url''s purposes?
>
> I have no idea, but as long as you need to resolve relative URLs, it
> is your friend.

Back on topic, the diff in PS seems to work. With the new calling
convention, of first concatenating the car and cadr of `base', so does
`expand-file-name', by the way.

Can anyone verify and install it?

João

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 5844257..244d6d6 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -32,6 +32,8 @@
 
 (eval-when-compile (require 'cl))
 (eval-when-compile (require 'url))      ;For url-filename's setf handler.
+
+(require 'url-expand)                  ; For url-expand-file-name
 (require 'browse-url)
 
 (defgroup shr nil
@@ -610,7 +612,7 @@ size, and full-buffer size."
 	 (concat (nth 3 base) url))
 	(t
 	 ;; Totally relative.
-	 (concat (car base) (expand-file-name url (cadr base))))))
+         (url-expand-file-name url (concat (car base) (cadr base))))))
 
 (defun shr-ensure-newline ()
   (unless (zerop (current-column))