diff options
| author | Lars Ingebrigtsen | 2016-09-14 11:11:17 +0200 |
|---|---|---|
| committer | Lars Ingebrigtsen | 2016-09-14 11:11:34 +0200 |
| commit | 9345e638f1f1b520aef234f88b2bb16f2323ed88 (patch) | |
| tree | f4e7dd592b91009acf254ab3819bcbba5c4863d1 | |
| parent | 3b9cbacf6110daf7cb2a838e28afef1e4f5ff831 (diff) | |
| download | emacs-9345e638f1f1b520aef234f88b2bb16f2323ed88.tar.gz emacs-9345e638f1f1b520aef234f88b2bb16f2323ed88.zip | |
Don't bug out on all-whitespace URLs
* lisp/net/shr.el (shr-expand-url): Don't bug out on
degenerate all-whitespace URLs.
| -rw-r--r-- | lisp/net/shr.el | 7 |
1 files 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." | |||
| 788 | ;; Strip leading whitespace | 788 | ;; Strip leading whitespace |
| 789 | (and url (string-match "\\`\\s-+" url) | 789 | (and url (string-match "\\`\\s-+" url) |
| 790 | (setq url (substring url (match-end 0)))) | 790 | (setq url (substring url (match-end 0)))) |
| 791 | (cond ((or (not url) | 791 | (cond ((zerop (length url)) |
| 792 | (not base) | 792 | (nth 3 base)) |
| 793 | ((or (not base) | ||
| 793 | (string-match "\\`[a-z]*:" url)) | 794 | (string-match "\\`[a-z]*:" url)) |
| 794 | ;; Absolute or empty URI | 795 | ;; Absolute or empty URI |
| 795 | (or url (nth 3 base))) | 796 | url) |
| 796 | ((eq (aref url 0) ?/) | 797 | ((eq (aref url 0) ?/) |
| 797 | (if (and (> (length url) 1) | 798 | (if (and (> (length url) 1) |
| 798 | (eq (aref url 1) ?/)) | 799 | (eq (aref url 1) ?/)) |