# HG changeset patch # User Richard M. Stallman # Date 740453039 0 # Node ID ea6739f778a5e4a75a2e722330573f17347929d1 # Parent 9d48091cd976674b95decd3cbb0447434c472123 (rmail-output): Check file can be read before trying to read part of it. diff -r 9d48091cd976 -r ea6739f778a5 lisp/mail/rmailout.el --- a/lisp/mail/rmailout.el Sat Jun 19 01:13:23 1993 +0000 +++ b/lisp/mail/rmailout.el Sat Jun 19 01:23:59 1993 +0000 @@ -162,13 +162,14 @@ ;; If we can do it, read a little of the file ;; to check whether it is an RMAIL file. ;; If it is, don't mess it up. - (insert-file-contents file-name nil 0 20) - (if (looking-at "BABYL OPTIONS:\n") - (error (save-excursion - (set-buffer rmailbuf) - (substitute-command-keys - "Use \\[rmail-output-to-rmail-file] to output to Rmail file `%s'")) - (file-name-nondirectory file-name))) + (and (file-readable-p file-name) + (progn (insert-file-contents file-name nil 0 20) + (looking-at "BABYL OPTIONS:\n")) + (error (save-excursion + (set-buffer rmailbuf) + (substitute-command-keys + "Use \\[rmail-output-to-rmail-file] to output to Rmail file `%s'")) + (file-name-nondirectory file-name))) (erase-buffer) (insert-buffer-substring rmailbuf) (insert "\n")