Permalink
Browse files

patch 8.0.0583: fold test hangs on MS-Windows

Problem:    Fold test hangs on MS-Windows.
Solution:   Avoid overflow in compare.
  • Loading branch information...
brammool committed Apr 23, 2017
1 parent 5b276aa commit b11c826ddc459813f9f991cdb8e8736b686a6328
Showing with 6 additions and 2 deletions.
  1. +4 −2 src/fold.c
  2. +2 −0 src/version.c
View
@@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
{
/* 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, linenr_T bot)
/* 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--)
{
View
@@ -764,6 +764,8 @@ static char *(features[]) =
static int included_patches[] =
{ /* Add new patch number below this line */
/**/
583,
/**/
582,
/**/

0 comments on commit b11c826

Please sign in to comment.