]> git.eshelyaron.com Git - emacs.git/commitdiff
; Avoid scraping non-readable files for maintainers
authorPhilip Kaludercic <philipk@posteo.net>
Wed, 19 Mar 2025 17:33:01 +0000 (18:33 +0100)
committerEshel Yaron <me@eshelyaron.com>
Thu, 20 Mar 2025 10:52:47 +0000 (12:52 +0200)
* lisp/mail/emacsbug.el (submit-emacs-patch): Check if a file
mentioned in a patch can be opened.  (Bug#77083)

(cherry picked from commit a77f10305c9ad0354987b09ec9a967021bb47d93)

lisp/mail/emacsbug.el

index f1fa33925713721d39ed56d63be6189345578665..020aaafc31bd163e2e3835292b0bc2308290e3f2 100644 (file)
@@ -543,10 +543,11 @@ Message buffer where you can explain more about the patch."
                  (with-temp-buffer
                    (insert-file-contents file)
                    (while (search-forward-regexp "^\\+\\{3\\} ./\\(.*\\)" nil t)
-                     (push (expand-file-name
-                            (match-string-no-properties 1)
-                            source-directory)
-                           files)))
+                     (let ((file (expand-file-name
+                                  (match-string-no-properties 1)
+                                  source-directory)))
+                       (when (file-readable-p file)
+                         (push file files)))))
                  (mapcan
                   (lambda (patch)
                     (seq-remove