@matheusbsbs / matheus-bagliano / commits / 710daa83fc
Fork 0

xdl_merge(): fix thinko

If one side's block (of changed lines) ends later than the other side's block, the former should be tested against the next block of the other side, not vice versa. Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de> Signed-off-by: Junio C Hamano <junkio@cox.net>

Johannes Schindelin committed Nov 30, 2006 at 00:25 UTC 710daa83fc76f79b8f2ee9a765d297187c2c1aeb
1 file changed +2 -2
xdiff/xmerge.c
+2 -2
@@ -318,13 +318,13 @@ static int xdl_do_merge(xdfenv_t *xe1, xdchange_t *xscr1, const char *name1,
318 xscr1->i1 = i2;
319 xscr1->i2 += xscr1->chg2;
320 xscr1->chg2 = 0;
321 - xscr1 = xscr1->next;
321 + xscr2 = xscr2->next;
322 } else if (i2 > i1) {
323 xscr2->chg1 -= i2 - i1;
324 xscr2->i1 = i1;
325 xscr2->i2 += xscr2->chg2;
326 xscr2->chg2 = 0;
327 - xscr2 = xscr2->next;
327 + xscr1 = xscr1->next;
328 } else {
329 xscr1 = xscr1->next;
330 xscr2 = xscr2->next;