From: Lars Ingebrigtsen Date: Wed, 14 Sep 2016 09:11:17 +0000 (+0200) Subject: Don't bug out on all-whitespace URLs X-Git-Tag: emacs-26.0.90~1602 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=9345e638f1f1b520aef234f88b2bb16f2323ed88;p=emacs.git Don't bug out on all-whitespace URLs * lisp/net/shr.el (shr-expand-url): Don't bug out on degenerate all-whitespace URLs. --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index 07009d06be9..a3cc8072a01 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) ?/))