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

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

[elpa] externals/debbugs 0dfc1d6 256/311: * packages/debbugs/debbugs-gnu


From: Stefan Monnier
Subject: [elpa] externals/debbugs 0dfc1d6 256/311: * packages/debbugs/debbugs-gnu.el (debbugs-gnu-fix-patch): Simplify a bit
Date: Sun, 29 Nov 2020 18:42:24 -0500 (EST)

branch: externals/debbugs
commit 0dfc1d6c53d2e8df7345bc3bf5a551b516425cbb
Author: Stefan Monnier <monnier@iro.umontreal.ca>
Commit: Stefan Monnier <monnier@iro.umontreal.ca>

    * packages/debbugs/debbugs-gnu.el (debbugs-gnu-fix-patch): Simplify a bit
    
    No funny \n inside file names.  Don't search twice for /.
---
 debbugs-gnu.el | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/debbugs-gnu.el b/debbugs-gnu.el
index dc3b353..caf9dea 100644
--- a/debbugs-gnu.el
+++ b/debbugs-gnu.el
@@ -2243,12 +2243,11 @@ If given a prefix, patch in the branch directory 
instead."
                                unless (string-match "[ #<>]" name)
                                return name)))
       (when target-name
-       (when (string-match "^/" target-name)
+       (when (string-match "\\`/" target-name)
          ;; This is an absolute path, so try to find the target.
-         (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))))
+         (while (and (not (file-exists-p (expand-file-name target-name dir)))
+                     (string-match "\\`[^/]*/" target-name))
+           (setq target-name (replace-match "" t t target-name))))
        ;; See whether we can find the file.
        (when (or (not (string-match "/" target-name))
                  (and (string-match "^[ab]/" target-name)



reply via email to

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