Skip to content

Commit 710daa8

Browse files
dschoJunio C Hamano
authored andcommitted
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>
1 parent 875b8ce commit 710daa8

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

xdiff/xmerge.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -318,13 +318,13 @@ static int xdl_do_merge(xdfenv_t *xe1, xdchange_t *xscr1, const char *name1,
318318
xscr1->i1 = i2;
319319
xscr1->i2 += xscr1->chg2;
320320
xscr1->chg2 = 0;
321-
xscr1 = xscr1->next;
321+
xscr2 = xscr2->next;
322322
} else if (i2 > i1) {
323323
xscr2->chg1 -= i2 - i1;
324324
xscr2->i1 = i1;
325325
xscr2->i2 += xscr2->chg2;
326326
xscr2->chg2 = 0;
327-
xscr2 = xscr2->next;
327+
xscr1 = xscr1->next;
328328
} else {
329329
xscr1 = xscr1->next;
330330
xscr2 = xscr2->next;

0 commit comments

Comments
 (0)