emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Emacs-diffs] master 9345e63: Don't bug out on all-whitespace URLs


From: Lars Ingebrigtsen
Subject: [Emacs-diffs] master 9345e63: Don't bug out on all-whitespace URLs
Date: Wed, 14 Sep 2016 09:13:03 +0000 (UTC)

branch: master
commit 9345e638f1f1b520aef234f88b2bb16f2323ed88
Author: Lars Ingebrigtsen <address@hidden>
Commit: Lars Ingebrigtsen <address@hidden>

    Don't bug out on all-whitespace URLs
    
    * lisp/net/shr.el (shr-expand-url): Don't bug out on
    degenerate all-whitespace URLs.
---
 lisp/net/shr.el |    7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/lisp/net/shr.el b/lisp/net/shr.el
index 07009d0..a3cc807 100644
--- a/lisp/net/shr.el
+++ b/lisp/net/shr.el
@@ -788,11 +788,12 @@ size, and full-buffer size."
   ;; Strip leading whitespace
   (and url (string-match "\\`\\s-+" url)
        (setq url (substring url (match-end 0))))
-  (cond ((or (not url)
-            (not base)
+  (cond ((zerop (length url))
+         (nth 3 base))
+        ((or (not base)
             (string-match "\\`[a-z]*:" url))
         ;; Absolute or empty URI
-        (or url (nth 3 base)))
+        url)
        ((eq (aref url 0) ?/)
         (if (and (> (length url) 1)
                  (eq (aref url 1) ?/))



reply via email to

[Prev in Thread] Current Thread [Next in Thread]