]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.0.0503: endless loop in updating folds with 32 bit ints v8.0.0503
authorBram Moolenaar <Bram@vim.org>
Thu, 23 Mar 2017 20:53:35 +0000 (21:53 +0100)
committerBram Moolenaar <Bram@vim.org>
Thu, 23 Mar 2017 20:53:35 +0000 (21:53 +0100)
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
src/version.c

index 305173918360505916cdb45259756b91907e33cb..8c66b78cd04ea3c916378b551bcdbec27e182cbd 100644 (file)
@@ -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
index 4b2ff6f5d9f497fb3b32c6160751513ffdbc48a4..b6cc7d65aa30f6c5a06131ecbcc4342ed6d7fe40 100644 (file)
@@ -764,6 +764,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    503,
 /**/
     502,
 /**/