To: vim_dev@googlegroups.com Subject: Patch 8.0.0583 Fcc: outbox From: Bram Moolenaar Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit ------------ Patch 8.0.0583 Problem: Fold test hangs on MS-Windows. Solution: Avoid overflow in compare. Files: src/fold.c *** ../vim-8.0.0582/src/fold.c 2017-04-22 22:40:07.252963462 +0200 --- src/fold.c 2017-04-23 16:45:14.563673689 +0200 *************** *** 2928,2934 **** { /* 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) { /* 3: need to split it. */ foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot); --- 2928,2934 ---- { /* 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 - 1 > bot) { /* 3: need to split it. */ foldSplit(gap, (int)(fp - (fold_T *)gap->ga_data), top, bot); *************** *** 2970,2979 **** /* foldReverseOrder() {{{2 */ static void ! foldReverseOrder(garray_T *gap, linenr_T start, linenr_T end) { fold_T *left, *right; fold_T tmp; for (; start < end; start++, end--) { --- 2970,2981 ---- /* foldReverseOrder() {{{2 */ static void ! 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--) { *** ../vim-8.0.0582/src/version.c 2017-04-22 23:49:48.442047574 +0200 --- src/version.c 2017-04-23 16:47:40.057692680 +0200 *************** *** 766,767 **** --- 766,769 ---- { /* Add new patch number below this line */ + /**/ + 583, /**/ -- [SIR LAUNCELOT runs back up the stairs, grabs a rope of the wall and swings out over the heads of the CROWD in a swashbuckling manner towards a large window. He stops just short of the window and is left swing pathetically back and forth.] LAUNCELOT: Excuse me ... could somebody give me a push ... "Monty Python and the Holy Grail" PYTHON (MONTY) PICTURES LTD /// Bram Moolenaar -- Bram@Moolenaar.net -- http://www.Moolenaar.net \\\ /// sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\ \\\ an exciting new programming language -- http://www.Zimbu.org /// \\\ help me help AIDS victims -- http://ICCF-Holland.org ///