threads / patch / 43772

patch, 4 partsxdl_merge(): fix thinko

Subject: [PATCH 4/4] xdl_merge(): fix thinko

## tl;dr

One message between Nov 29, 2006 and Nov 29, 2006. Diffs are folded; open one to read it.

replies: 0people: 1as markdown or json

Johannes Schindelin· Nov 29, 2006, 23:25 UTC · lore

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>
---
 xdiff/xmerge.c |    4 ++--
 1 files changed, 2 insertions(+), 2 deletions(-)
Show changes to xdiff/xmerge.c +2 −2
diff --git a/xdiff/xmerge.c b/xdiff/xmerge.c
index 9fe2059..6d4f9b6 100644
--- a/xdiff/xmerge.c
+++ b/xdiff/xmerge.c
@@ -318,13 +318,13 @@ static int xdl_do_merge(xdfenv_t *xe1, x
 			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;
-- 
1.4.4.g5aac-dirty

← back to recent threads