summaryrefslogtreecommitdiffstats
path: root/src/fold.c
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2017-03-23 21:53:35 +0100
committerBram Moolenaar <Bram@vim.org>2017-03-23 21:53:35 +0100
commit9d20ce6970158de69202a82529d9e97827a9e71b (patch)
tree764737cb525e82bb948fe6aa7cf976f514cfdff7 /src/fold.c
parenta37ffaa5e0a47e2db27bc0cc23f49e7094f47f3b (diff)
patch 8.0.0503: endless loop in updating folds with 32 bit intsv8.0.0503
Problem: Endless loop in updating folds with 32 bit ints. Solution: Subtract from LHS instead of add to the RHS. (Matthew Malcomson)
Diffstat (limited to 'src/fold.c')
-rw-r--r--src/fold.c2
1 files changed, 1 insertions, 1 deletions
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