Skip to content

Commit

Permalink
xdl_merge(): fix thinko
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Johannes Schindelin authored and Junio C Hamano committed Dec 3, 2006
1 parent 875b8ce commit 710daa8
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions xdiff/xmerge.c
Original file line number Diff line number Diff line change
Expand Up @@ -318,13 +318,13 @@ static int xdl_do_merge(xdfenv_t *xe1, xdchange_t *xscr1, const char *name1,
xscr1->i1 = i2;
xscr1->i2 += xscr1->chg2;
xscr1->chg2 = 0;
xscr1 = xscr1->next;
xscr2 = xscr2->next;
} else if (i2 > i1) {
xscr2->chg1 -= i2 - i1;
xscr2->i1 = i1;
xscr2->i2 += xscr2->chg2;
xscr2->chg2 = 0;
xscr2 = xscr2->next;
xscr1 = xscr1->next;
} else {
xscr1 = xscr1->next;
xscr2 = xscr2->next;
Expand Down

0 comments on commit 710daa8

Please sign in to comment.