]> git.eshelyaron.com Git - emacs.git/commitdiff
shr: handle anonymous documents with an empty base
authorAndreas Schwab <schwab@linux-m68k.org>
Fri, 11 Oct 2024 06:49:26 +0000 (08:49 +0200)
committerEshel Yaron <me@eshelyaron.com>
Mon, 14 Oct 2024 17:38:13 +0000 (19:38 +0200)
* lisp/net/shr.el (shr-parse-base): Make sure local is non-nil.

(cherry picked from commit bf49113d696b00971d756ce2b67fe15c0ff1ba81)

lisp/net/shr.el

index cd0e482aee7627b510df6d32aa342e9948a108a0..f1062acf7e426aba951816eaf78eabb863a8453f 100644 (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)