emacs-elpa-diffs
[Top][All Lists]
Advanced

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

[elpa] externals/debbugs fa1a2d2 255/311: Only fix up the file if it rea


From: Stefan Monnier
Subject: [elpa] externals/debbugs fa1a2d2 255/311: Only fix up the file if it really exists
Date: Sun, 29 Nov 2020 18:42:23 -0500 (EST)

branch: externals/debbugs
commit fa1a2d2648741421603c15bb4ac39453bee57809
Author: Lars Ingebrigtsen <larsi@gnus.org>
Commit: Lars Ingebrigtsen <larsi@gnus.org>

    Only fix up the file if it really exists
---
 debbugs-gnu.el | 28 ++++++++++++++--------------
 1 file changed, 14 insertions(+), 14 deletions(-)

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index ec3fa52..dc3b353 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -2245,7 +2245,7 @@ If given a prefix, patch in the branch directory instead."
       (when target-name
        (when (string-match "^/" target-name)
          ;; This is an absolute path, so try to find the target.
-         (while (and (search "/" target-name)
+         (while (and (cl-search "/" target-name)
                      (not (file-exists-p (expand-file-name target-name dir))))
            (setq target-name (replace-regexp-in-string "^[^/]*/" ""
                                                        target-name))))
@@ -2255,19 +2255,19 @@ If given a prefix, patch in the branch directory 
instead."
                       (not (file-exists-p
                             (expand-file-name (substring target-name 2)
                                               dir))))
-                 (file-exists-p (expand-file-name target-name dir))))
-       ;; We have a simple patch that refers to a file somewhere in the
-       ;; tree.  Find it.
-       (when-let ((files (directory-files-recursively
-                          dir
-                          (concat "^" (regexp-quote
-                                       (file-name-nondirectory target-name))
-                                  "$"))))
-         (when (re-search-forward "^[+]+ .*" nil t)
-           (replace-match (concat "+++ a"
-                                  (substring (car files) (length dir))
-                                  (match-string 1))
-                          nil t)))))
+                 (file-exists-p (expand-file-name target-name dir)))
+         ;; We have a simple patch that refers to a file somewhere in the
+         ;; tree.  Find it.
+         (when-let ((files (directory-files-recursively
+                            dir
+                            (concat "^" (regexp-quote
+                                         (file-name-nondirectory target-name))
+                                    "$"))))
+           (when (re-search-forward "^[+]+ .*" nil t)
+             (replace-match (concat "+++ a"
+                                    (substring (car files) (length dir))
+                                    (match-string 1))
+                            nil t))))))
     (forward-line 2)))
 
 (defun debbugs-gnu-find-contributor (string)



reply via email to

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