1
0
mirror of https://git.savannah.gnu.org/git/emacs.git synced 2024-11-21 06:55:39 +00:00

shr: handle anonymous documents with an empty base

* lisp/net/shr.el (shr-parse-base): Make sure local is non-nil.
This commit is contained in:
Andreas Schwab 2024-10-11 08:49:26 +02:00
parent 42393b9883
commit bf49113d69

View File

@ -950,7 +950,7 @@ When `shr-fill-text' is nil, only indent."
;; NB: <base href=""> URI may itself be relative to the document's URI.
(setq url (shr-expand-url url))
(let* ((parsed (url-generic-parse-url url))
(local (url-filename parsed)))
(local (or (url-filename parsed) "")))
(setf (url-filename parsed) "")
;; Chop off the bit after the last slash.
(when (string-match "\\`\\(.*/\\)[^/]+\\'" local)