master 9f61797da5f: Accept file:// scheme in 'mml-expand-html-into-multipart-related'

Eli Zaretskii <[email protected]>
Newsgroups gmane.emacs.diffs
Message-ID <[email protected]>
branch: master
commit 9f61797da5f7e5c7b1a50dbf8f2cae4c6355ec60
Author: Morgan Willcock <[email protected]>
Commit: Eli Zaretskii <[email protected]>

    Accept file:// scheme in 'mml-expand-html-into-multipart-related'
    
    * lisp/gnus/mml.el (mml-expand-html-into-multipart-related):
    Accept URLs which both use a file:// scheme and have an empty host
    component.  These URLs describe absolute local file names and are
    the only format accepted by 'url-generic-parse-url' which can
    contain a Windows driver letter.  (Bug#81250)
---
 lisp/gnus/mml.el | 13 ++++++++++---
 1 file changed, 10 insertions(+), 3 deletions(-)

diff --git a/lisp/gnus/mml.el b/lisp/gnus/mml.el
index 88217b15398..75430ba2e6e 100644
--- a/lisp/gnus/mml.el
+++ b/lisp/gnus/mml.el
@@ -556,12 +556,19 @@ type detected."
 				(libxml-parse-html-region
 				 (point) (progn (forward-sexp) (point))))))
 		 (end (point))
-		 (parsed (url-generic-parse-url (cdr (assq 'src (cadr img))))))
-	    (when (and (null (url-type parsed))
+                 (url (cdr (assq 'src (cadr img))))
+                 (parsed (url-generic-parse-url url)))
+            (when (and (let ((type (url-type parsed)))
+                         (or
+                          ;; No scheme.
+                          (null type)
+                          ;; A file scheme with an empty host part.
+                          (and (string-equal type "file")
+                               (string-empty-p (url-host parsed)))))
                        (not (zerop (length (url-filename parsed))))
 		       (file-exists-p (url-filename parsed)))
 	      (goto-char start)
-	      (when (search-forward (url-filename parsed) end t)
+              (when (search-forward url end t)
 		(let ((cid (format "fsf.%d" cid)))
 		  (replace-match (concat "cid:" cid) t t)
 		  (push (list cid (url-filename parsed)
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.