# HG changeset patch # User Christian Brabandt # Date 1492959604 -7200 # Node ID e9924d19ee371464e6adc957c19e7f14023a457f # Parent 156696a8b3167dc38d853ac38f6c322764c43980 patch 8.0.0583: fold test hangs on MS-Windows commit https://github.com/vim/vim/commit/b11c826ddc459813f9f991cdb8e8736b686a6328 Author: Bram Moolenaar Date: Sun Apr 23 16:48:20 2017 +0200 patch 8.0.0583: fold test hangs on MS-Windows Problem: Fold test hangs on MS-Windows. Solution: Avoid overflow in compare. diff --git a/src/fold.c b/src/fold.c --- a/src/fold.c +++ b/src/fold.c @@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, { /* 2: or 3: need to delete nested folds */ foldRemove(&fp->fd_nested, top - fp->fd_top, bot - fp->fd_top); - if (fp->fd_top + fp->fd_len > bot + 1) + if (fp->fd_top + fp->fd_len - 1 > bot) { /* 3: need to split it. */ foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot); @@ -2970,10 +2970,12 @@ foldRemove(garray_T *gap, linenr_T top, /* foldReverseOrder() {{{2 */ static void -foldReverseOrder(garray_T *gap, linenr_T start, linenr_T end) +foldReverseOrder(garray_T *gap, linenr_T start_arg, linenr_T end_arg) { fold_T *left, *right; fold_T tmp; + linenr_T start = start_arg; + linenr_T end = end_arg; for (; start < end; start++, end--) { diff --git a/src/version.c b/src/version.c --- a/src/version.c +++ b/src/version.c @@ -765,6 +765,8 @@ static char *(features[]) = static int included_patches[] = { /* Add new patch number below this line */ /**/ + 583, +/**/ 582, /**/ 581,