From 2c4970560fbb0d1efe95f8a002c181bc706c1a13 Mon Sep 17 00:00:00 2001 From: Tino Calancha Date: Wed, 7 Dec 2016 21:07:45 +0900 Subject: [PATCH] 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. --- lisp/vc/ediff-ptch.el | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/lisp/vc/ediff-ptch.el b/lisp/vc/ediff-ptch.el index 6a07f805334..6e8e9473fcc 100644 --- a/lisp/vc/ediff-ptch.el +++ b/lisp/vc/ediff-ptch.el @@ -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." -- 2.39.2