]> code.delx.au - gnu-emacs/commitdiff
Fix long filename handling of byte-compile-fix-header.
authorStefan Monnier <monnier@iro.umontreal.ca>
Thu, 31 May 2012 05:56:57 +0000 (13:56 +0800)
committerChong Yidong <cyd@gnu.org>
Thu, 31 May 2012 05:56:57 +0000 (13:56 +0800)
* lisp/emacs-lisp/bytecomp.el (byte-compile-fix-header): Handle
arbitrary file name lengths (Bug#11585).

lisp/ChangeLog
lisp/emacs-lisp/bytecomp.el

index 2ebff3d0eed0966e943b823b9dda453c166bc508..2a04a9ca7992fced9b8ac3add37e89e29b6214dc 100644 (file)
@@ -1,3 +1,8 @@
+2012-05-31  Stefan Monnier  <monnier@iro.umontreal.ca>
+
+       * emacs-lisp/bytecomp.el (byte-compile-fix-header): Handle
+       arbitrary file name lengths (Bug#11585).
+
 2012-05-28  Martin Rudalics  <rudalics@gmx.at>
 
        * desktop.el (desktop-read): Clear previous and next buffers for
index 93c6518d215a607b15a8ee2a8d0a91ae6d799f42..b03e8e252fdf628c4c99512da9454d3e2bc8e0ab 100644 (file)
@@ -1931,7 +1931,7 @@ and will be removed soon.  See (elisp)Backquote in the manual."))
             (byte-compile-fix-header byte-compile-current-file)))))
     byte-compile--outbuffer))
 
-(defun byte-compile-fix-header (filename)
+(defun byte-compile-fix-header (_filename)
   "If the current buffer has any multibyte characters, insert a version test."
   (when (< (point-max) (position-bytes (point-max)))
     (goto-char (point-min))
@@ -1956,12 +1956,10 @@ and will be removed soon.  See (elisp)Backquote in the manual."))
        ;; don't try to check the version number.
        "     (< (aref emacs-version (1- (length emacs-version))) ?A)\n"
        (format "     (string-lessp emacs-version \"%s\")\n" minimum-version)
-       "     (error \"`"
-       ;; prin1-to-string is used to quote backslashes.
-       (substring (prin1-to-string (file-name-nondirectory filename))
-                 1 -1)
-       (format "' was compiled for Emacs %s or later\"))\n\n"
-              minimum-version))
+       ;; Because the header must fit in a fixed width, we cannot
+       ;; insert arbitrary-length file names (Bug#11585).
+       "     (error \"`%s' was compiled for "
+       (format "Emacs %s or later\" load-file-name))\n\n" minimum-version))
       ;; Now compensate for any change in size, to make sure all
       ;; positions in the file remain valid.
       (setq delta (- (point-max) old-header-end))