]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
patch 8.2.4042: Vim9: build error v8.2.4042
authorBram Moolenaar <Bram@vim.org>
Sat, 8 Jan 2022 16:02:59 +0000 (16:02 +0000)
committerBram Moolenaar <Bram@vim.org>
Sat, 8 Jan 2022 16:02:59 +0000 (16:02 +0000)
Problem:    Vim9: build error.
Solution:   Use grow array instead of character pointer.

src/version.c
src/vim9execute.c

index 27512d44f4028481b5c49d50acb27e267e730fac..579718e7b02372e72621de6095872ede7bd3b9c2 100644 (file)
@@ -750,6 +750,8 @@ static char *(features[]) =
 
 static int included_patches[] =
 {   /* Add new patch number below this line */
+/**/
+    4042,
 /**/
     4041,
 /**/
index 63c07fe043e842d9721f8da00dd714f9aa442750..5fab27dc435a6606d9f3316e13cda328ad831e3d 100644 (file)
@@ -3344,13 +3344,14 @@ exec_instructions(ectx_T *ectx)
                    list_functions(NULL);
                else
                {
-                   exarg_T ea;
-                   char_u  *line_to_free = NULL;
+                   exarg_T     ea;
+                   garray_T    lines_to_free;
 
                    CLEAR_FIELD(ea);
                    ea.cmd = ea.arg = iptr->isn_arg.string;
-                   define_function(&ea, NULL, &line_to_free);
-                   vim_free(line_to_free);
+                   ga_init2(&lines_to_free, sizeof(char_u *), 50);
+                   define_function(&ea, NULL, &lines_to_free);
+                   ga_clear_strings(&lines_to_free);
                }
                break;