changeset 27677:567f4f964ccc

patch 8.2.4364: MS-Windows: still running out of memory for a very long line Commit: https://github.com/vim/vim/commit/45491660787043ea412719544881db691338d730 Author: Bram Moolenaar <Bram@vim.org> Date: Sat Feb 12 21:59:51 2022 +0000 patch 8.2.4364: MS-Windows: still running out of memory for a very long line Problem: MS-Windows: still running out of memory for a very long line. Solution: Check for negative length.
author Bram Moolenaar <Bram@vim.org>
date Sat, 12 Feb 2022 23:00:03 +0100
parents b4daa7e68abd
children 1646525507aa
files src/indent.c src/version.c
diffstat 2 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/indent.c
+++ b/src/indent.c
@@ -1726,7 +1726,7 @@ ex_retab(exarg_T *eap)
 			len = num_spaces + num_tabs;
 			old_len = (long)STRLEN(ptr);
 			new_len = old_len - col + start_col + len + 1;
-			if (new_len >= MAXCOL)
+			if (new_len <= 0 || new_len >= MAXCOL)
 			{
 			    emsg(_(e_resulting_text_too_long));
 			    break;
--- a/src/version.c
+++ b/src/version.c
@@ -751,6 +751,8 @@ static char *(features[]) =
 static int included_patches[] =
 {   /* Add new patch number below this line */
 /**/
+    4364,
+/**/
     4363,
 /**/
     4362,