diff options
| author | Gerd Moellmann | 2000-08-29 19:29:27 +0000 |
|---|---|---|
| committer | Gerd Moellmann | 2000-08-29 19:29:27 +0000 |
| commit | fd5f61d36241864ff7107001972a771f7a5b65ec (patch) | |
| tree | a0639938361ab00d14400e6b443a6bfdff10d702 /lisp/progmodes/executable.el | |
| parent | 13142d704450fc960c38d34cbbf0a3137c0fdd59 (diff) | |
| download | emacs-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.el | 3 |
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. |
| 272 | If file already has any execute bits set at all, do not change existing | 272 | If file already has any execute bits set at all, do not change existing |
| 273 | file modes." | 273 | file 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))) |