]> git.eshelyaron.com Git - emacs.git/commitdiff
Don't bug out on all-whitespace URLs
authorLars Ingebrigtsen <larsi@gnus.org>
Wed, 14 Sep 2016 09:11:17 +0000 (11:11 +0200)
committerLars Ingebrigtsen <larsi@gnus.org>
Wed, 14 Sep 2016 09:11:34 +0000 (11:11 +0200)
* lisp/net/shr.el (shr-expand-url): Don't bug out on
degenerate all-whitespace URLs.

lisp/net/shr.el

index 07009d06be961bebb5ce7a4077e66a36e665db2c..a3cc8072a0122eec9eb342cd9dfb70103676e2c8 100644 (file)
@@ -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) ?/))