From: Lars Ingebrigtsen Date: Sat, 1 Oct 2022 14:56:19 +0000 (+0200) Subject: Make mailcap--regexp-quote-type more resilient X-Git-Tag: emacs-29.0.90~1856^2~100^2 X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=3215760194f9d28f0053c38d9b2eb0942914615c;p=emacs.git Make mailcap--regexp-quote-type more resilient * lisp/net/mailcap.el (mailcap--regexp-quote-type): Make more resilient in the presence of junk. --- 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."