diff options
| author | Stefan Monnier | 2012-05-31 13:56:57 +0800 |
|---|---|---|
| committer | Chong Yidong | 2012-05-31 13:56:57 +0800 |
| commit | dd41169b6cb0105b0766f3d368c657ebafc19cba (patch) | |
| tree | 77b2108f7a54b9eb8c94dc7ce9e3c62c15499074 | |
| parent | d5fd2c5421d8335f9e36265fe8eb6224c1ff76dd (diff) | |
| download | emacs-dd41169b6cb0105b0766f3d368c657ebafc19cba.tar.gz emacs-dd41169b6cb0105b0766f3d368c657ebafc19cba.zip | |
Fix long filename handling of byte-compile-fix-header.
* lisp/emacs-lisp/bytecomp.el (byte-compile-fix-header): Handle
arbitrary file name lengths (Bug#11585).
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/emacs-lisp/bytecomp.el | 12 |
2 files changed, 10 insertions, 7 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 2ebff3d0eed..2a04a9ca799 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-05-31 Stefan Monnier <monnier@iro.umontreal.ca> | ||
| 2 | |||
| 3 | * emacs-lisp/bytecomp.el (byte-compile-fix-header): Handle | ||
| 4 | arbitrary file name lengths (Bug#11585). | ||
| 5 | |||
| 1 | 2012-05-28 Martin Rudalics <rudalics@gmx.at> | 6 | 2012-05-28 Martin Rudalics <rudalics@gmx.at> |
| 2 | 7 | ||
| 3 | * desktop.el (desktop-read): Clear previous and next buffers for | 8 | * desktop.el (desktop-read): Clear previous and next buffers for |
diff --git a/lisp/emacs-lisp/bytecomp.el b/lisp/emacs-lisp/bytecomp.el index 93c6518d215..b03e8e252fd 100644 --- a/lisp/emacs-lisp/bytecomp.el +++ b/lisp/emacs-lisp/bytecomp.el | |||
| @@ -1931,7 +1931,7 @@ and will be removed soon. See (elisp)Backquote in the manual.")) | |||
| 1931 | (byte-compile-fix-header byte-compile-current-file))))) | 1931 | (byte-compile-fix-header byte-compile-current-file))))) |
| 1932 | byte-compile--outbuffer)) | 1932 | byte-compile--outbuffer)) |
| 1933 | 1933 | ||
| 1934 | (defun byte-compile-fix-header (filename) | 1934 | (defun byte-compile-fix-header (_filename) |
| 1935 | "If the current buffer has any multibyte characters, insert a version test." | 1935 | "If the current buffer has any multibyte characters, insert a version test." |
| 1936 | (when (< (point-max) (position-bytes (point-max))) | 1936 | (when (< (point-max) (position-bytes (point-max))) |
| 1937 | (goto-char (point-min)) | 1937 | (goto-char (point-min)) |
| @@ -1956,12 +1956,10 @@ and will be removed soon. See (elisp)Backquote in the manual.")) | |||
| 1956 | ;; don't try to check the version number. | 1956 | ;; don't try to check the version number. |
| 1957 | " (< (aref emacs-version (1- (length emacs-version))) ?A)\n" | 1957 | " (< (aref emacs-version (1- (length emacs-version))) ?A)\n" |
| 1958 | (format " (string-lessp emacs-version \"%s\")\n" minimum-version) | 1958 | (format " (string-lessp emacs-version \"%s\")\n" minimum-version) |
| 1959 | " (error \"`" | 1959 | ;; Because the header must fit in a fixed width, we cannot |
| 1960 | ;; prin1-to-string is used to quote backslashes. | 1960 | ;; insert arbitrary-length file names (Bug#11585). |
| 1961 | (substring (prin1-to-string (file-name-nondirectory filename)) | 1961 | " (error \"`%s' was compiled for " |
| 1962 | 1 -1) | 1962 | (format "Emacs %s or later\" load-file-name))\n\n" minimum-version)) |
| 1963 | (format "' was compiled for Emacs %s or later\"))\n\n" | ||
| 1964 | minimum-version)) | ||
| 1965 | ;; Now compensate for any change in size, to make sure all | 1963 | ;; Now compensate for any change in size, to make sure all |
| 1966 | ;; positions in the file remain valid. | 1964 | ;; positions in the file remain valid. |
| 1967 | (setq delta (- (point-max) old-header-end)) | 1965 | (setq delta (- (point-max) old-header-end)) |