summaryrefslogtreecommitdiff
path: root/lisp/gnus/gnus-art.el
diff options
context:
space:
mode:
authorLars Ingebrigtsen <larsi@gnus.org>2019-08-25 07:57:30 +0200
committerLars Ingebrigtsen <larsi@gnus.org>2019-08-25 07:57:30 +0200
commit2e6e250521f5076bfa1afb32c24d0075d34b4c53 (patch)
tree1c69f1fbfb78cc89b21bd4e17dce126efc5ee351 /lisp/gnus/gnus-art.el
parent84f1674ee8cbd83ea219595e9adec2d148946976 (diff)
downloademacs-2e6e250521f5076bfa1afb32c24d0075d34b4c53.tar.gz
emacs-2e6e250521f5076bfa1afb32c24d0075d34b4c53.tar.bz2
emacs-2e6e250521f5076bfa1afb32c24d0075d34b4c53.zip
Disallow just hitting RET in gnus-mime-replace-part
* lisp/gnus/gnus-art.el (gnus-mime-replace-part): Don't replace the part if the file to replace it with doesn't exist (bug#36864).
Diffstat (limited to 'lisp/gnus/gnus-art.el')
-rw-r--r--lisp/gnus/gnus-art.el5
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/gnus/gnus-art.el b/lisp/gnus/gnus-art.el
index 930b0a0510a..04cb087737f 100644
--- a/lisp/gnus/gnus-art.el
+++ b/lisp/gnus/gnus-art.el
@@ -5059,7 +5059,10 @@ and `gnus-mime-delete-part', and not provided at run-time normally."
(list
(read-file-name "Replace MIME part with file: "
(or mm-default-directory default-directory)
- nil nil)))
+ nil t)))
+ (unless (file-regular-p (file-truename file))
+ (error "Can't replace part with %s, which isn't a regular file"
+ file))
(gnus-mime-save-part-and-strip file))
(defun gnus-mime-save-part-and-strip (&optional file)