]> git.eshelyaron.com Git - emacs.git/commitdiff
ediff-context-diff-label-regexp: Detect the end of second file
authorTino Calancha <tino.calancha@gmail.com>
Wed, 7 Dec 2016 12:07:45 +0000 (21:07 +0900)
committerTino Calancha <tino.calancha@gmail.com>
Wed, 7 Dec 2016 12:07:45 +0000 (21:07 +0900)
* lisp/vc/ediff-ptch.el (ediff-context-diff-label-regexp): Skip
'\n' in file names (Bug#25010).
* test/lisp/vc/ediff-ptch-tests.el: New file.
(ibuffer-test-bug25010): Add test for Bug#25010.

lisp/vc/ediff-ptch.el

index 6a07f805334f94051d98ee170f56df19979a3bda..6e8e9473fcc6d14148a22b757042e1abc30a205a 100644 (file)
@@ -120,11 +120,12 @@ patch.  So, don't change these variables, unless the default doesn't work."
 ;; This context diff does not recognize spaces inside files, but removing ' '
 ;; from [^ \t] breaks normal patches for some reason
 (defcustom ediff-context-diff-label-regexp
-  (concat "\\("        ; context diff 2-liner
-         "^\\*\\*\\* +\\([^ \t]+\\)[^*]+[\t ]*\n--- +\\([^ \t]+\\)"
-         "\\|"         ; unified format diff 2-liner
-         "^--- +\\([^ \t]+\\).*\n\\+\\+\\+ +\\([^ \t]+\\)"
-         "\\)")
+  (let ((stuff "\\([^ \t\n]+\\)"))
+    (concat "\\("      ; context diff 2-liner
+            "^\\*\\*\\* +" stuff "[^*]+[\t ]*\n--- +" stuff
+            "\\|"      ; unified format diff 2-liner
+            "^--- +" stuff ".*\n\\+\\+\\+ +" stuff
+            "\\)"))
   "Regexp matching filename 2-liners at the start of each context diff.
 You probably don't want to change that, unless you are using an obscure patch
 program."