]> git.neil.brown.name Git - wiggle.git/commitdiff
merge: fix another bug in isolate_conflicts.
authorNeilBrown <neilb@suse.de>
Mon, 19 Aug 2013 07:44:16 +0000 (17:44 +1000)
committerNeilBrown <neilb@suse.de>
Mon, 19 Aug 2013 07:44:16 +0000 (17:44 +1000)
In unusual cases we can fall off the end - better check.

Signed-off-by: NeilBrown <neilb@suse.de>
merge2.c

index 50dd404bb8baea1f618b431085000c81661f3568..95a4ca2a3ea6abef76b6a60c21482e9a452b430e 100644 (file)
--- a/merge2.c
+++ b/merge2.c
@@ -376,7 +376,9 @@ int isolate_conflicts(struct file af, struct file bf, struct file cf,
                        }
                        while (j <= i)
                                m[j++].in_conflict = 0;
-               out:;
+               out:
+                       if (m[i].type == End)
+                               break;
                }
                for (k = 1; k < m[i].al; k++)
                        if (words || ends_line(af.list[m[i].a+k])) {