diff options
| author | Leo Liu | 2012-12-01 23:45:38 +0800 |
|---|---|---|
| committer | Leo Liu | 2012-12-01 23:45:38 +0800 |
| commit | ff3d86d0996d665f9cbb217ca24a63e59b058460 (patch) | |
| tree | 76b33fb51f30b985b7707a2f2459526e7815ce9d | |
| parent | b9cf4db5c9210d4ccf7faf86c4ec4439a98a7a58 (diff) | |
| download | emacs-ff3d86d0996d665f9cbb217ca24a63e59b058460.tar.gz emacs-ff3d86d0996d665f9cbb217ca24a63e59b058460.zip | |
* lisp/files.el (dir-locals-read-from-file): Check file non-empty
before reading.
Fixes: debbugs:13038
| -rw-r--r-- | lisp/ChangeLog | 5 | ||||
| -rw-r--r-- | lisp/files.el | 17 |
2 files changed, 14 insertions, 8 deletions
diff --git a/lisp/ChangeLog b/lisp/ChangeLog index 735798e3f3e..eb41fff8c9a 100644 --- a/lisp/ChangeLog +++ b/lisp/ChangeLog | |||
| @@ -1,3 +1,8 @@ | |||
| 1 | 2012-12-01 Leo Liu <sdl.web@gmail.com> | ||
| 2 | |||
| 3 | * files.el (dir-locals-read-from-file): Check file non-empty | ||
| 4 | before reading. (Bug#13038) | ||
| 5 | |||
| 1 | 2012-11-28 Glenn Morris <rgm@gnu.org> | 6 | 2012-11-28 Glenn Morris <rgm@gnu.org> |
| 2 | 7 | ||
| 3 | * jka-cmpr-hook.el (jka-compr-get-compression-info): | 8 | * jka-cmpr-hook.el (jka-compr-get-compression-info): |
diff --git a/lisp/files.el b/lisp/files.el index 51f8256f71a..62ad96cf28c 100644 --- a/lisp/files.el +++ b/lisp/files.el | |||
| @@ -3625,14 +3625,15 @@ is found. Returns the new class name." | |||
| 3625 | (condition-case err | 3625 | (condition-case err |
| 3626 | (progn | 3626 | (progn |
| 3627 | (insert-file-contents file) | 3627 | (insert-file-contents file) |
| 3628 | (let* ((dir-name (file-name-directory file)) | 3628 | (unless (zerop (buffer-size)) |
| 3629 | (class-name (intern dir-name)) | 3629 | (let* ((dir-name (file-name-directory file)) |
| 3630 | (variables (let ((read-circle nil)) | 3630 | (class-name (intern dir-name)) |
| 3631 | (read (current-buffer))))) | 3631 | (variables (let ((read-circle nil)) |
| 3632 | (dir-locals-set-class-variables class-name variables) | 3632 | (read (current-buffer))))) |
| 3633 | (dir-locals-set-directory-class dir-name class-name | 3633 | (dir-locals-set-class-variables class-name variables) |
| 3634 | (nth 5 (file-attributes file))) | 3634 | (dir-locals-set-directory-class dir-name class-name |
| 3635 | class-name)) | 3635 | (nth 5 (file-attributes file))) |
| 3636 | class-name))) | ||
| 3636 | (error (message "Error reading dir-locals: %S" err) nil))))) | 3637 | (error (message "Error reading dir-locals: %S" err) nil))))) |
| 3637 | 3638 | ||
| 3638 | (defcustom enable-remote-dir-locals nil | 3639 | (defcustom enable-remote-dir-locals nil |