[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[bug-patch] [PATCH 3/3] Fix the merge functionality.
From: |
Steven Drake |
Subject: |
[bug-patch] [PATCH 3/3] Fix the merge functionality. |
Date: |
Fri, 30 Dec 2011 15:40:09 +1300 (NZDT) |
User-agent: |
Alpine 2.00 (LNX 1167 2008-08-23) |
Because of the breakage caused by the asymmetric hunks changes.
Signed-off-by: Steven Drake <address@hidden>
---
src/merge.c | 6 ++++--
1 files changed, 4 insertions(+), 2 deletions(-)
diff --git a/src/merge.c b/src/merge.c
index d2ba795..b01d0d1 100644
--- a/src/merge.c
+++ b/src/merge.c
@@ -45,7 +45,7 @@ static void compute_changes (lin, lin, lin, lin, char *, char
*);
static lin
locate_merge (lin *matched)
{
- lin first_guess = pch_first () + in_offset;
+ lin first_guess = pch_first ();
lin pat_lines = pch_ptrn_lines ();
lin context_lines = count_context_lines ();
lin max_where = input_lines - pat_lines + context_lines + 1;
@@ -219,7 +219,9 @@ merge_hunk (int hunk, struct outstate *outstate, lin where,
bool *somefailed)
while (pch_char (new) == '=' || pch_char (new) == '\n')
new++;
- if (where)
+ if (where
+ && (pch_prefix_context () > 0 )
+ && (pch_suffix_context () > 0 ))
{
applies_cleanly = true;
matched = pch_ptrn_lines ();
--
1.7.6.3