summaryrefslogtreecommitdiff
path: root/lisp/net
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2022-10-01 16:56:19 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2022-10-01 16:56:19 +0200
commit3215760194f9d28f0053c38d9b2eb0942914615c (patch)
tree273265fde707283918c30e03dd52ad38f7aab97c /lisp/net
parente50a3b57921e8b690d3c3adb993e2441d5970116 (diff)
downloademacs-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.el6
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."