From: Dmitry Gutov Date: Fri, 26 Jan 2024 00:52:35 +0000 (+0200) Subject: project--read-project-list: Handle corrupted file contents X-Git-Url: http://git.eshelyaron.com/gitweb/?a=commitdiff_plain;h=4e1aae169204e609ddca5e54bb4f1acc1f22194c;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). (cherry picked from commit 22a58fccb763da6ec52f4bea98f91647b71ee1f0) --- diff --git a/lisp/progmodes/project.el b/lisp/progmodes/project.el index 325e207b70d..9996a3aa556 100644 --- a/lisp/progmodes/project.el +++ b/lisp/progmodes/project.el @@ -1702,7 +1702,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)