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

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

[elpa] master df816bb: * packages/debbugs/debbugs-gnu.el (debbugs-gnu-fi


From: Stefan Monnier
Subject: [elpa] master df816bb: * packages/debbugs/debbugs-gnu.el (debbugs-gnu-fix-patch): Simplify a bit
Date: Mon, 24 Jun 2019 16:43:04 -0400 (EDT)

branch: master
commit df816bb60ba960e29d6503b797f6102e5420aeda
Author: Stefan Monnier <address@hidden>
Commit: Stefan Monnier <address@hidden>

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

diff --git a/packages/debbugs/debbugs-gnu.el b/packages/debbugs/debbugs-gnu.el
index dc3b353..caf9dea 100644
--- a/packages/debbugs/debbugs-gnu.el
+++ b/packages/debbugs/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]