summaryrefslogtreecommitdiff
path: root/xdiff/xemit.c
diff options
context:
space:
mode:
Diffstat (limited to 'xdiff/xemit.c')
-rw-r--r--xdiff/xemit.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/xdiff/xemit.c b/xdiff/xemit.c
index 4625c1b421..05bfa41f10 100644
--- a/xdiff/xemit.c
+++ b/xdiff/xemit.c
@@ -59,9 +59,10 @@ static int xdl_emit_record(xdfile_t *xdf, long ri, char const *pre, xdemitcb_t *
*/
xdchange_t *xdl_get_hunk(xdchange_t *xscr, xdemitconf_t const *xecfg) {
xdchange_t *xch, *xchp;
+ long max_common = 2 * xecfg->ctxlen + xecfg->interhunkctxlen;
for (xchp = xscr, xch = xscr->next; xch; xchp = xch, xch = xch->next)
- if (xch->i1 - (xchp->i1 + xchp->chg1) > 2 * xecfg->ctxlen)
+ if (xch->i1 - (xchp->i1 + xchp->chg1) > max_common)
break;
return xchp;