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)
diff --git a/src/fold.c b/src/fold.c
index 3051739..8c66b78 100644
--- a/src/fold.c
+++ b/src/fold.c
@@ -2755,7 +2755,7 @@
/* 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
diff --git a/src/version.c b/src/version.c
index 4b2ff6f..b6cc7d6 100644
--- a/src/version.c
+++ b/src/version.c
@@ -765,6 +765,8 @@
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
+ 503,
+/**/
502,
/**/
501,