From b1a40fca593ad9763479ed5063c2a18d616105d3 Mon Sep 17 00:00:00 2001 From: NeilBrown Date: Fri, 23 Aug 2013 13:10:12 +1000 Subject: [PATCH] Browser: avoid possible infinite loop. This can sometimes loop indefintely, so check for 'End' and drop out. Signed-off-by: NeilBrown --- vpatch.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vpatch.c b/vpatch.c index 3732c99..1328d56 100644 --- a/vpatch.c +++ b/vpatch.c @@ -1605,7 +1605,8 @@ static int merge_window(struct plist *p, FILE *f, int reverse, int replace, spos.state = 1; while (spos.p.m >= 0 && spos.state != 0) prev_mline(&spos, fm, fb, fa, ci.merger, smode); - while (!same_mpos(spos, tpos)) + while (!same_mpos(spos, tpos) && + ci.merger[spos.p.m].type != End) next_mline(&spos, fm, fb, fa, ci.merger, smode); (void)attrset(a_sep); -- 2.39.5