From 342720e689e2aa03e893f4187b69fa0386daae42 Mon Sep 17 00:00:00 2001 From: Neil Brown Date: Thu, 10 May 2012 17:09:52 +1000 Subject: [PATCH] isolate_conflicts: don't look for eol that cannot be there. When looking for 'wiggles' we need to track whole lines in the original file. But when looking for an end-of-line we shouldn't look at an merge-item that doesn't even exist in the original file. Reported-by: Chris Peterson Signed-off-by: NeilBrown --- merge2.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/merge2.c b/merge2.c index 565181e..3408076 100644 --- a/merge2.c +++ b/merge2.c @@ -295,7 +295,7 @@ static int isolate_conflicts(struct file af, struct file bf, struct file cf, } i = j - 1; } - if (ends_line(af.list[m[i].a+m[i].al-1])) { + if (m[i].al > 0 && ends_line(af.list[m[i].a+m[i].al-1])) { unmatched = 0; changed = 0; } -- 2.39.5