git/list[1] front-page[2] threads[3] people[4] search[5] about
 

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

From
Johannes Schindelin <johannes.schindelin@gmx.de>
Date
Nov 29, 2006, 23:25 UTC
Message-ID
<Pine.LNX.4.63.0611300024350.30004@wbgn013.biozentrum.uni-wuerzburg.de>

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(-)
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
Message 1 of 1 in “xdl_merge(): fix thinko”
  1. 4/4 xdl_merge(): fix thinkoJohannes Schindelin, Nov 29, 2006

Read the whole thread, see it on lore, or plain text.

$ cat FOOTERMessages come from the public archive at lore.kernel.org/git, fetched every hour. The front page is chosen and written each morning by an AI editor and can be wrong; the threads themselves are the record. About and API. For agents: an MCP server at https://gitlist.dev/mcp, and any thread, story or person page as Markdown by adding .md to its URL (or sending Accept: text/markdown). Details in /llms.txt.