From 9d20ce6970158de69202a82529d9e97827a9e71b Mon Sep 17 00:00:00 2001 From: Bram Moolenaar Date: Thu, 23 Mar 2017 21:53:35 +0100 Subject: patch 8.0.0503: endless loop in updating folds with 32 bit ints Problem: Endless loop in updating folds with 32 bit ints. Solution: Subtract from LHS instead of add to the RHS. (Matthew Malcomson) --- src/fold.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/fold.c') diff --git a/src/fold.c b/src/fold.c index 3051739183..8c66b78cd0 100644 --- a/src/fold.c +++ b/src/fold.c @@ -2755,7 +2755,7 @@ foldUpdateIEMSRecurse( /* End of fold found, update the length when it got shorter. */ if (fp->fd_len != flp->lnum - fp->fd_top) { - if (fp->fd_top + fp->fd_len > bot + 1) + if (fp->fd_top + fp->fd_len - 1 > bot) { /* fold continued below bot */ if (getlevel == foldlevelMarker -- cgit v1.2.3