diff options
| author | Eli Zaretskii | 2021-10-03 14:34:08 +0300 |
|---|---|---|
| committer | Eli Zaretskii | 2021-10-03 14:34:08 +0300 |
| commit | b228ec9fab8ea5e09da4d3c3f41d7859d88afb7d (patch) | |
| tree | a436c985e9b6402f468a8a042d654d853b499f35 | |
| parent | 7fb27895090f8f9fe6cfa6311a77ec2c794adc84 (diff) | |
| download | emacs-b228ec9fab8ea5e09da4d3c3f41d7859d88afb7d.tar.gz emacs-b228ec9fab8ea5e09da4d3c3f41d7859d88afb7d.zip | |
Fix reading the tail of a file in shorthands.el
* lisp/shorthands.el (hack-elisp-shorthands): Fix reading past
3000-character limit from EOF. (Bug#50946)
| -rw-r--r-- | lisp/shorthands.el | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/lisp/shorthands.el b/lisp/shorthands.el index b8204d62a2e..6162efd6095 100644 --- a/lisp/shorthands.el +++ b/lisp/shorthands.el | |||
| @@ -40,7 +40,10 @@ except for extraction of the buffer-local value of | |||
| 40 | (with-temp-buffer | 40 | (with-temp-buffer |
| 41 | (while (and (< (buffer-size) 3000) (>= from 0)) | 41 | (while (and (< (buffer-size) 3000) (>= from 0)) |
| 42 | (insert-file-contents fullname nil from to) | 42 | (insert-file-contents fullname nil from to) |
| 43 | (setq to from from (- from 100))) | 43 | (setq to from |
| 44 | from (cond | ||
| 45 | ((= from 0) -1) | ||
| 46 | (t (max 0 (- from 100)))))) | ||
| 44 | ;; FIXME: relies on the `hack-local-variables--find-variables' | 47 | ;; FIXME: relies on the `hack-local-variables--find-variables' |
| 45 | ;; detail of files.el. That function should be exported, | 48 | ;; detail of files.el. That function should be exported, |
| 46 | ;; possibly be refactored into two parts, since we're only | 49 | ;; possibly be refactored into two parts, since we're only |