diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2022-10-01 16:56:19 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2022-10-01 16:56:19 +0200 |
commit | 3215760194f9d28f0053c38d9b2eb0942914615c (patch) | |
tree | 273265fde707283918c30e03dd52ad38f7aab97c /lisp/net | |
parent | e50a3b57921e8b690d3c3adb993e2441d5970116 (diff) | |
download | emacs-3215760194f9d28f0053c38d9b2eb0942914615c.tar.gz emacs-3215760194f9d28f0053c38d9b2eb0942914615c.tar.bz2 emacs-3215760194f9d28f0053c38d9b2eb0942914615c.zip |
Make mailcap--regexp-quote-type more resilient
* lisp/net/mailcap.el (mailcap--regexp-quote-type): Make more
resilient in the presence of junk.
Diffstat (limited to 'lisp/net')
-rw-r--r-- | lisp/net/mailcap.el | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/lisp/net/mailcap.el b/lisp/net/mailcap.el index b678df30bd4..aa0c1726553 100644 --- a/lisp/net/mailcap.el +++ b/lisp/net/mailcap.el @@ -1066,8 +1066,10 @@ If FORCE, re-parse even if already parsed." extns nil))))) (defun mailcap--regexp-quote-type (type) - (pcase-let ((`(,major ,minor) (split-string type "/"))) - (concat major "/" (regexp-quote minor)))) + (if (not (string-search "/" type)) + type + (pcase-let ((`(,major ,minor) (split-string type "/"))) + (concat major "/" (regexp-quote minor))))) (defun mailcap-extension-to-mime (extn) "Return the MIME content type of the file extensions EXTN." |