]> git.eshelyaron.com Git - emacs.git/commitdiff
(executable-make-buffer-file-executable-if-script-p): Check that
authorGerd Moellmann <gerd@gnu.org>
Tue, 29 Aug 2000 19:29:27 +0000 (19:29 +0000)
committerGerd Moellmann <gerd@gnu.org>
Tue, 29 Aug 2000 19:29:27 +0000 (19:29 +0000)
buffer contains at least 2 characters.

lisp/ChangeLog
lisp/progmodes/executable.el

index 071227b61ebb35f323c5039890c4b71fba603975..5f0fd50b7b4a36377774c1dcb913820b17e15e24 100644 (file)
@@ -1,3 +1,9 @@
+2000-08-29  Gerd Moellmann  <gerd@gnu.org>
+
+       * progmodes/executable.el
+       (executable-make-buffer-file-executable-if-script-p): Check that
+       buffer contains at least 2 characters.
+
 2000-08-29  Eli Zaretskii  <eliz@is.elta.co.il>
 
        * help.el (help-make-xrefs, help-xref-mule-regexp): Doc fix.
index df373ba67fd194c95e6c2eed815d710dcc6c1888..eecaab17e3ddb0d100e66fe6fd8aa0d1c00ee1bc 100644 (file)
@@ -271,7 +271,8 @@ The magic number of such a command displays all lines but itself."
   "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)))