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 | |
| 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.
| -rw-r--r-- | lisp/ChangeLog | 6 | ||||
| -rw-r--r-- | lisp/progmodes/executable.el | 3 |
2 files changed, 8 insertions, 1 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 071227b61eb..5f0fd50b7b4 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,9 @@ | |||
| 1 | 2000-08-29 Gerd Moellmann <gerd@gnu.org> | ||
| 2 | |||
| 3 | * progmodes/executable.el | ||
| 4 | (executable-make-buffer-file-executable-if-script-p): Check that | ||
| 5 | buffer contains at least 2 characters. | ||
| 6 | |||
| 1 | 2000-08-29 Eli Zaretskii <eliz@is.elta.co.il> | 7 | 2000-08-29 Eli Zaretskii <eliz@is.elta.co.il> |
| 2 | 8 | ||
| 3 | * help.el (help-make-xrefs, help-xref-mule-regexp): Doc fix. | 9 | * help.el (help-make-xrefs, help-xref-mule-regexp): Doc fix. |
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))) |