emacs-diffs
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

master 22a58fccb76 1/2: project--read-project-list: Handle corrupted fil


From: Dmitry Gutov
Subject: master 22a58fccb76 1/2: project--read-project-list: Handle corrupted file contents
Date: Thu, 25 Jan 2024 20:00:37 -0500 (EST)

branch: master
commit 22a58fccb763da6ec52f4bea98f91647b71ee1f0
Author: Dmitry Gutov <dmitry@gutov.dev>
Commit: Dmitry Gutov <dmitry@gutov.dev>

    project--read-project-list: Handle corrupted file contents
    
    * lisp/progmodes/project.el (project--read-project-list):
    Handle the 'end-of-file' error (bug#68546).
---
 lisp/progmodes/project.el | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

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)



reply via email to

[Prev in Thread] Current Thread [Next in Thread]