diff options
author | Lars Ingebrigtsen <larsi@gnus.org> | 2019-08-25 07:57:30 +0200 |
---|---|---|
committer | Lars Ingebrigtsen <larsi@gnus.org> | 2019-08-25 07:57:30 +0200 |
commit | 2e6e250521f5076bfa1afb32c24d0075d34b4c53 (patch) | |
tree | 1c69f1fbfb78cc89b21bd4e17dce126efc5ee351 /lisp/gnus/gnus-art.el | |
parent | 84f1674ee8cbd83ea219595e9adec2d148946976 (diff) | |
download | emacs-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.el | 5 |
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) |