mirror of
https://git.savannah.gnu.org/git/emacs.git
synced 2024-11-22 07:09:54 +00:00
Fix args-out-of-range error in epa-file-insert-file-contents
* lisp/epa-file.el (epa-file-insert-file-contents): Don't bug out on a region that's longer than the file (bug#47718). Copyright-paperwork-exempt: yes
This commit is contained in:
parent
104c5e3d57
commit
636e9fd6a0
@ -198,7 +198,9 @@ encryption is used."
|
||||
(mapcar #'car (epg-context-result-for
|
||||
context 'encrypted-to)))
|
||||
(if (or beg end)
|
||||
(setq string (substring string (or beg 0) end)))
|
||||
(setq string (substring string
|
||||
(or beg 0)
|
||||
(and end (min end (length string))))))
|
||||
(save-excursion
|
||||
;; If visiting, bind off buffer-file-name so that
|
||||
;; file-locking will not ask whether we should
|
||||
|
Loading…
Reference in New Issue
Block a user