From: Dmitry Gutov Date: Fri, 26 Jan 2024 00:52:35 +0000 (+0200) Subject: project--read-project-list: Handle corrupted file contents X-Git-Tag: archive/raspbian/1%30.1+1-3+rpi1^2~2^2~20^2~2823 X-Git-Url: https://dgit.raspbian.org/?a=commitdiff_plain;h=22a58fccb763da6ec52f4bea98f91647b71ee1f0;p=emacs.git project--read-project-list: Handle corrupted file contents * lisp/progmodes/project.el (project--read-project-list): Handle the 'end-of-file' error (bug#68546). --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index ab4504fa027..da782ad5537 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1707,7 +1707,10 @@ With some possible metadata (to be decided).") (let ((name (car elem))) (list (if (file-remote-p name) name (abbreviate-file-name name))))) - (read (current-buffer)))))) + (condition-case nil + (read (current-buffer)) + (end-of-file + (warn "Failed to read the projects list file due to unexpected EOF"))))))) (unless (seq-every-p (lambda (elt) (stringp (car-safe elt))) project--list)