+2013-06-27 Leo Liu <sdl.web@gmail.com>
+
+ * net/eww.el (eww-read-bookmarks): Check file size.
+
2013-06-26 Stefan Monnier <monnier@iro.umontreal.ca>
* emacs-lisp/nadvice.el (advice--defalias-fset): Move advice back to
(pp eww-bookmarks (current-buffer))))
(defun eww-read-bookmarks ()
- (with-temp-buffer
- (insert-file-contents
- (expand-file-name "eww-bookmarks" user-emacs-directory))
- (setq eww-bookmarks (read (current-buffer)))))
+ (let ((file (expand-file-name "eww-bookmarks" user-emacs-directory)))
+ (setq eww-bookmarks
+ (unless (zerop (or (nth 7 (file-attributes file)) 0))
+ (with-temp-buffer
+ (insert-file-contents file)
+ (read (current-buffer)))))))
(defun eww-list-bookmarks ()
"Display the bookmarks."