aboutsummaryrefslogtreecommitdiffstats
path: root/lisp/progmodes/executable.el
diff options
context:
space:
mode:
authorGerd Moellmann2000-08-29 19:29:27 +0000
committerGerd Moellmann2000-08-29 19:29:27 +0000
commitfd5f61d36241864ff7107001972a771f7a5b65ec (patch)
treea0639938361ab00d14400e6b443a6bfdff10d702 /lisp/progmodes/executable.el
parent13142d704450fc960c38d34cbbf0a3137c0fdd59 (diff)
downloademacs-fd5f61d36241864ff7107001972a771f7a5b65ec.tar.gz
emacs-fd5f61d36241864ff7107001972a771f7a5b65ec.zip
(executable-make-buffer-file-executable-if-script-p): Check that
buffer contains at least 2 characters.
Diffstat (limited to 'lisp/progmodes/executable.el')
-rw-r--r--lisp/progmodes/executable.el3
1 files changed, 2 insertions, 1 deletions
diff --git a/lisp/progmodes/executable.el b/lisp/progmodes/executable.el
index df373ba67fd..eecaab17e3d 100644
--- a/lisp/progmodes/executable.el
+++ b/lisp/progmodes/executable.el
@@ -271,7 +271,8 @@ The magic number of such a command displays all lines but itself."
271 "Make file executable according to umask if not already executable. 271 "Make file executable according to umask if not already executable.
272If file already has any execute bits set at all, do not change existing 272If file already has any execute bits set at all, do not change existing
273file modes." 273file modes."
274 (and (save-restriction 274 (and (>= (buffer-size) 2)
275 (save-restriction
275 (widen) 276 (widen)
276 (string= "#!" (buffer-substring 1 3))) 277 (string= "#!" (buffer-substring 1 3)))
277 (let* ((current-mode (file-modes (buffer-file-name))) 278 (let* ((current-mode (file-modes (buffer-file-name)))