Skip to content

Commit b11c826

Browse files
committed
patch 8.0.0583: fold test hangs on MS-Windows
Problem: Fold test hangs on MS-Windows. Solution: Avoid overflow in compare.
1 parent 5b276aa commit b11c826

2 files changed

Lines changed: 6 additions & 2 deletions

File tree

src/fold.c

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2928,7 +2928,7 @@ foldRemove(garray_T *gap, linenr_T top, linenr_T bot)
29282928
{
29292929
/* 2: or 3: need to delete nested folds */
29302930
foldRemove(&fp->fd_nested, top - fp->fd_top, bot - fp->fd_top);
2931-
if (fp->fd_top + fp->fd_len > bot + 1)
2931+
if (fp->fd_top + fp->fd_len - 1 > bot)
29322932
{
29332933
/* 3: need to split it. */
29342934
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)
29702970

29712971
/* foldReverseOrder() {{{2 */
29722972
static void
2973-
foldReverseOrder(garray_T *gap, linenr_T start, linenr_T end)
2973+
foldReverseOrder(garray_T *gap, linenr_T start_arg, linenr_T end_arg)
29742974
{
29752975
fold_T *left, *right;
29762976
fold_T tmp;
2977+
linenr_T start = start_arg;
2978+
linenr_T end = end_arg;
29772979

29782980
for (; start < end; start++, end--)
29792981
{

src/version.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -764,6 +764,8 @@ static char *(features[]) =
764764

765765
static int included_patches[] =
766766
{ /* Add new patch number below this line */
767+
/**/
768+
583,
767769
/**/
768770
582,
769771
/**/

0 commit comments

Comments
 (0)