From: Neil Brown Date: Thu, 10 May 2012 07:09:52 +0000 (+1000) Subject: isolate_conflicts: don't look for eol that cannot be there. X-Git-Tag: v0.9~14 X-Git-Url: http://git.neil.brown.name/?a=commitdiff_plain;h=342720e689e2aa03e893f4187b69fa0386daae42;p=wiggle.git 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 --- 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; }