[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110979: * lisp/files.el (dir-loca
From: |
Leo Liu |
Subject: |
[Emacs-diffs] /srv/bzr/emacs/emacs-24 r110979: * lisp/files.el (dir-locals-read-from-file): Check file non-empty |
Date: |
Sat, 01 Dec 2012 23:45:38 +0800 |
User-agent: |
Bazaar (2.5.0) |
------------------------------------------------------------
revno: 110979
fixes bug: http://debbugs.gnu.org/13038
committer: Leo Liu <address@hidden>
branch nick: emacs-24
timestamp: Sat 2012-12-01 23:45:38 +0800
message:
* lisp/files.el (dir-locals-read-from-file): Check file non-empty
before reading.
modified:
lisp/ChangeLog
lisp/files.el
=== modified file 'lisp/ChangeLog'
--- a/lisp/ChangeLog 2012-11-28 08:37:38 +0000
+++ b/lisp/ChangeLog 2012-12-01 15:45:38 +0000
@@ -1,3 +1,8 @@
+2012-12-01 Leo Liu <address@hidden>
+
+ * files.el (dir-locals-read-from-file): Check file non-empty
+ before reading. (Bug#13038)
+
2012-11-28 Glenn Morris <address@hidden>
* jka-cmpr-hook.el (jka-compr-get-compression-info):
=== modified file 'lisp/files.el'
--- a/lisp/files.el 2012-11-18 02:13:19 +0000
+++ b/lisp/files.el 2012-12-01 15:45:38 +0000
@@ -3625,14 +3625,15 @@
(condition-case err
(progn
(insert-file-contents file)
- (let* ((dir-name (file-name-directory file))
- (class-name (intern dir-name))
- (variables (let ((read-circle nil))
- (read (current-buffer)))))
- (dir-locals-set-class-variables class-name variables)
- (dir-locals-set-directory-class dir-name class-name
- (nth 5 (file-attributes file)))
- class-name))
+ (unless (zerop (buffer-size))
+ (let* ((dir-name (file-name-directory file))
+ (class-name (intern dir-name))
+ (variables (let ((read-circle nil))
+ (read (current-buffer)))))
+ (dir-locals-set-class-variables class-name variables)
+ (dir-locals-set-directory-class dir-name class-name
+ (nth 5 (file-attributes file)))
+ class-name)))
(error (message "Error reading dir-locals: %S" err) nil)))))
(defcustom enable-remote-dir-locals nil
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [Emacs-diffs] /srv/bzr/emacs/emacs-24 r110979: * lisp/files.el (dir-locals-read-from-file): Check file non-empty,
Leo Liu <=