From: Andreas Schwab Date: Fri, 11 Oct 2024 06:49:26 +0000 (+0200) Subject: shr: handle anonymous documents with an empty base X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=608cea614b759432f67ffe01918c456489152d15;p=emacs.git shr: handle anonymous documents with an empty base * lisp/net/shr.el (shr-parse-base): Make sure local is non-nil. (cherry picked from commit bf49113d696b00971d756ce2b67fe15c0ff1ba81) --- diff --git a/lisp/net/shr.el b/lisp/net/shr.el index cd0e482aee7..f1062acf7e4 100644 --- a/lisp/net/shr.el +++ b/lisp/net/shr.el @@ -950,7 +950,7 @@ When `shr-fill-text' is nil, only indent." ;; NB: 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)