changeset 31281:87580ecaceee

(executable-make-buffer-file-executable-if-script-p): Check that buffer contains at least 2 characters.
author Gerd Moellmann <gerd@gnu.org>
date Tue, 29 Aug 2000 19:27:02 +0000
parents 55ce1d116cc7
children 13d1af0d1a1f
files lisp/progmodes/executable.el
diffstat 1 files changed, 2 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/lisp/progmodes/executable.el	Tue Aug 29 17:38:28 2000 +0000
+++ b/lisp/progmodes/executable.el	Tue Aug 29 19:27:02 2000 +0000
@@ -271,7 +271,8 @@
   "Make file executable according to umask if not already executable.
 If file already has any execute bits set at all, do not change existing
 file modes."
-  (and (save-restriction
+  (and (>= (buffer-size) 2)
+       (save-restriction
 	 (widen)
 	 (string= "#!" (buffer-substring 1 3)))
        (let* ((current-mode (file-modes (buffer-file-name)))