6c1aee8
commit 9c986353e420ead6e706262bf204d6e03322c300
6c1aee8
Author: Andreas Gruenbacher <agruen@gnu.org>
6c1aee8
Date:   Fri Aug 17 13:35:40 2018 +0200
6c1aee8
6c1aee8
    Fix swapping fake lines in pch_swap
6c1aee8
    
6c1aee8
    * src/pch.c (pch_swap): Fix swapping p_bfake and p_efake when there is a
6c1aee8
    blank line in the middle of a context-diff hunk: that empty line stays
6c1aee8
    in the middle of the hunk and isn't swapped.
6c1aee8
    
6c1aee8
    Fixes: https://savannah.gnu.org/bugs/index.php?53133
6c1aee8
e60be2b
diff --git a/src/pch.c b/src/pch.c
e60be2b
index e92bc64..a500ad9 100644
e60be2b
--- a/src/pch.c
e60be2b
+++ b/src/pch.c
e60be2b
@@ -2122,7 +2122,7 @@ pch_swap (void)
e60be2b
     }
e60be2b
     if (p_efake >= 0) {			/* fix non-freeable ptr range */
e60be2b
 	if (p_efake <= i)
e60be2b
-	    n = p_end - i + 1;
e60be2b
+	    n = p_end - p_ptrn_lines;
e60be2b
 	else
e60be2b
 	    n = -i;
e60be2b
 	p_efake += n;