Mercurial > emacs
diff lisp/progmodes/executable.el @ 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 | 2485d23636b2 |
| children | b174db545cfd |
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)))
