summaryrefslogtreecommitdiff
path: root/xdiff/xmerge.c
diff options
context:
space:
mode:
authorJohannes Schindelin <Johannes.Schindelin@gmx.de>2006-11-30 00:25:11 +0100
committerJunio C Hamano <junkio@cox.net>2006-12-02 17:28:19 -0800
commit710daa83fc76f79b8f2ee9a765d297187c2c1aeb (patch)
tree9e3e18087e83977b4f5df6c7057d7d17a1a672e3 /xdiff/xmerge.c
parent875b8ce47650d712c8f464cfedb9147673fe3ff7 (diff)
downloadgit-710daa83fc76f79b8f2ee9a765d297187c2c1aeb.tar.gz
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>
Diffstat (limited to 'xdiff/xmerge.c')
-rw-r--r--xdiff/xmerge.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c
index 3f5dc87fd2..1fe7a1b060 100644
--- a/xdiff/xmerge.c
+++ b/xdiff/xmerge.c
@@ -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;