ediff-context-diff-label-regexp: Detect the end of second file

* 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.
This commit is contained in:
Tino Calancha 2016-12-07 21:07:45 +09:00
parent 7b1e97f0e6
commit 2c4970560f

View 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."