[gnus git] branch master updated: m0-7-57-g87ffe4f =1= (shr-expand-url): Expand URLs that start with a slash correctly.

Lars Magne Ingebrigtsen <[email protected]>
Newsgroups gmane.emacs.gnus.cvs
Message-ID <[email protected]>
       via  87ffe4fceb752e20460aa80a6d582a8ee09eafde (commit)
      from  d54fa592ab919f897f6d0505b70beb90153e561f (commit)


- Log -----------------------------------------------------------------
commit 87ffe4fceb752e20460aa80a6d582a8ee09eafde
Author: Lars Magne Ingebrigtsen <[email protected]>
Date:   Mon Jun 10 23:49:06 2013 +0200

    (shr-expand-url): Expand URLs that start with a slash correctly.

diff --git a/lisp/ChangeLog b/lisp/ChangeLog
index 3f0250e..1c17850 100644
--- a/lisp/ChangeLog
+++ b/lisp/ChangeLog
@@ -1,5 +1,8 @@
 2013-06-10  Lars Magne Ingebrigtsen  <[email protected]>
 
+	* shr.el (shr-expand-url): Expand URLs that start with a slash
+	correctly.
+
 	* eww.el (eww-submit): Get submit button logic right.
 
 	* shr.el (shr-final-table-render): New variable to signal when we're
diff --git a/lisp/shr.el b/lisp/shr.el
index 7a63675..d9e267e 100644
--- a/lisp/shr.el
+++ b/lisp/shr.el
@@ -491,6 +491,7 @@ size, and full-buffer size."
       ;; Absolute URL.
       url
     (let ((base shr-base))
+      ;; Chop off query string.
       (when (string-match "^\\([^?]+\\)[?]" base)
 	(setq base (match-string 1 base)))
       (cond
@@ -500,6 +501,9 @@ size, and full-buffer size."
        ((and (not (string-match "/\\'" base))
 	     (not (string-match "\\`/" url)))
 	(concat base "/" url))
+       ((and (string-match "\\`/" url)
+	     (string-match "\\(\\`[^:]*://[^/]+\\)/" base))
+	(concat (match-string 1 base) url))
        (t
 	(concat base url))))))
 

-----------------------------------------------------------------------
Those revisions listed above that are new to this repository have
not appeared on any other notification email; so we listed those
revisions in full, above.

Summary of changes:
 lisp/ChangeLog |    3 +++
 lisp/shr.el    |    4 ++++
 2 files changed, 7 insertions(+), 0 deletions(-)

This is an automated email from the git hooks/post-receive script. It was
generated because a ref change was pushed to the repository containing
the project "Gnus Project".

The branch, master has been updated


hooks/post-receive
-- 
Gnus Project
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.