From 9345e638f1f1b520aef234f88b2bb16f2323ed88 Mon Sep 17 00:00:00 2001 From: Lars Ingebrigtsen Date: Wed, 14 Sep 2016 11:11:17 +0200 Subject: [PATCH] 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 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) ?/)) -- 2.11.4.GIT