mirror of
https://github.com/vim/vim.git
synced 2025-09-25 03:54:15 -04:00
patch 8.2.4040: keeping track of allocated lines is too complicated
Problem: Keeping track of allocated lines in user functions is too complicated. Solution: Instead of freeing individual lines keep them all until the end.
This commit is contained in:
17
src/alloc.c
17
src/alloc.c
@@ -702,7 +702,7 @@ ga_init(garray_T *gap)
|
|||||||
}
|
}
|
||||||
|
|
||||||
void
|
void
|
||||||
ga_init2(garray_T *gap, int itemsize, int growsize)
|
ga_init2(garray_T *gap, size_t itemsize, int growsize)
|
||||||
{
|
{
|
||||||
ga_init(gap);
|
ga_init(gap);
|
||||||
gap->ga_itemsize = itemsize;
|
gap->ga_itemsize = itemsize;
|
||||||
@@ -789,7 +789,7 @@ ga_concat_strings(garray_T *gap, char *sep)
|
|||||||
* When out of memory nothing changes and FAIL is returned.
|
* When out of memory nothing changes and FAIL is returned.
|
||||||
*/
|
*/
|
||||||
int
|
int
|
||||||
ga_add_string(garray_T *gap, char_u *p)
|
ga_copy_string(garray_T *gap, char_u *p)
|
||||||
{
|
{
|
||||||
char_u *cp = vim_strsave(p);
|
char_u *cp = vim_strsave(p);
|
||||||
|
|
||||||
@@ -805,6 +805,19 @@ ga_add_string(garray_T *gap, char_u *p)
|
|||||||
return OK;
|
return OK;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* Add string "p" to "gap".
|
||||||
|
* When out of memory "p" is freed and FAIL is returned.
|
||||||
|
*/
|
||||||
|
int
|
||||||
|
ga_add_string(garray_T *gap, char_u *p)
|
||||||
|
{
|
||||||
|
if (ga_grow(gap, 1) == FAIL)
|
||||||
|
return FAIL;
|
||||||
|
((char_u **)(gap->ga_data))[gap->ga_len++] = p;
|
||||||
|
return OK;
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Concatenate a string to a growarray which contains bytes.
|
* Concatenate a string to a growarray which contains bytes.
|
||||||
* When "s" is NULL does not do anything.
|
* When "s" is NULL does not do anything.
|
||||||
|
@@ -587,7 +587,7 @@ ignore_error_for_testing(char_u *error)
|
|||||||
if (STRCMP("RESET", error) == 0)
|
if (STRCMP("RESET", error) == 0)
|
||||||
ga_clear_strings(&ignore_error_list);
|
ga_clear_strings(&ignore_error_list);
|
||||||
else
|
else
|
||||||
ga_add_string(&ignore_error_list, error);
|
ga_copy_string(&ignore_error_list, error);
|
||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
|
@@ -17,10 +17,11 @@ void ga_clear(garray_T *gap);
|
|||||||
void ga_clear_strings(garray_T *gap);
|
void ga_clear_strings(garray_T *gap);
|
||||||
int ga_copy_strings(garray_T *from, garray_T *to);
|
int ga_copy_strings(garray_T *from, garray_T *to);
|
||||||
void ga_init(garray_T *gap);
|
void ga_init(garray_T *gap);
|
||||||
void ga_init2(garray_T *gap, int itemsize, int growsize);
|
void ga_init2(garray_T *gap, size_t itemsize, int growsize);
|
||||||
int ga_grow(garray_T *gap, int n);
|
int ga_grow(garray_T *gap, int n);
|
||||||
int ga_grow_inner(garray_T *gap, int n);
|
int ga_grow_inner(garray_T *gap, int n);
|
||||||
char_u *ga_concat_strings(garray_T *gap, char *sep);
|
char_u *ga_concat_strings(garray_T *gap, char *sep);
|
||||||
|
int ga_copy_string(garray_T *gap, char_u *p);
|
||||||
int ga_add_string(garray_T *gap, char_u *p);
|
int ga_add_string(garray_T *gap, char_u *p);
|
||||||
void ga_concat(garray_T *gap, char_u *s);
|
void ga_concat(garray_T *gap, char_u *s);
|
||||||
void ga_concat_len(garray_T *gap, char_u *s, size_t len);
|
void ga_concat_len(garray_T *gap, char_u *s, size_t len);
|
||||||
|
@@ -38,7 +38,7 @@ char_u *untrans_function_name(char_u *name);
|
|||||||
char_u *get_scriptlocal_funcname(char_u *funcname);
|
char_u *get_scriptlocal_funcname(char_u *funcname);
|
||||||
char_u *save_function_name(char_u **name, int *is_global, int skip, int flags, funcdict_T *fudi);
|
char_u *save_function_name(char_u **name, int *is_global, int skip, int flags, funcdict_T *fudi);
|
||||||
void list_functions(regmatch_T *regmatch);
|
void list_functions(regmatch_T *regmatch);
|
||||||
ufunc_T *define_function(exarg_T *eap, char_u *name_arg, char_u **line_to_free);
|
ufunc_T *define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free);
|
||||||
void ex_function(exarg_T *eap);
|
void ex_function(exarg_T *eap);
|
||||||
void ex_defcompile(exarg_T *eap);
|
void ex_defcompile(exarg_T *eap);
|
||||||
int eval_fname_script(char_u *p);
|
int eval_fname_script(char_u *p);
|
||||||
|
@@ -1757,6 +1757,21 @@ def Test_nested_function_with_args_split()
|
|||||||
CheckScriptFailure(lines, 'E1173: Text found after endfunction: BBBB')
|
CheckScriptFailure(lines, 'E1173: Text found after endfunction: BBBB')
|
||||||
enddef
|
enddef
|
||||||
|
|
||||||
|
def Test_error_in_function_args()
|
||||||
|
var lines =<< trim END
|
||||||
|
def FirstFunction()
|
||||||
|
def SecondFunction(J =
|
||||||
|
# Nois
|
||||||
|
# one
|
||||||
|
|
||||||
|
enddef|BBBB
|
||||||
|
enddef
|
||||||
|
# Compile all functions
|
||||||
|
defcompile
|
||||||
|
END
|
||||||
|
CheckScriptFailure(lines, 'E488:')
|
||||||
|
enddef
|
||||||
|
|
||||||
def Test_return_type_wrong()
|
def Test_return_type_wrong()
|
||||||
CheckScriptFailure([
|
CheckScriptFailure([
|
||||||
'def Func(): number',
|
'def Func(): number',
|
||||||
@@ -2048,7 +2063,6 @@ func Test_free_dict_while_in_funcstack()
|
|||||||
endfunc
|
endfunc
|
||||||
|
|
||||||
def Run_Test_free_dict_while_in_funcstack()
|
def Run_Test_free_dict_while_in_funcstack()
|
||||||
|
|
||||||
# this was freeing the TermRun() default argument dictionary while it was
|
# this was freeing the TermRun() default argument dictionary while it was
|
||||||
# still referenced in a funcstack_T
|
# still referenced in a funcstack_T
|
||||||
var lines =<< trim END
|
var lines =<< trim END
|
||||||
|
@@ -1021,7 +1021,7 @@ may_get_cmd_block(exarg_T *eap, char_u *p, char_u **tofree, int *flags)
|
|||||||
char_u *line = NULL;
|
char_u *line = NULL;
|
||||||
|
|
||||||
ga_init2(&ga, sizeof(char_u *), 10);
|
ga_init2(&ga, sizeof(char_u *), 10);
|
||||||
if (ga_add_string(&ga, p) == FAIL)
|
if (ga_copy_string(&ga, p) == FAIL)
|
||||||
return retp;
|
return retp;
|
||||||
|
|
||||||
// If the argument ends in "}" it must have been concatenated already
|
// If the argument ends in "}" it must have been concatenated already
|
||||||
@@ -1038,7 +1038,7 @@ may_get_cmd_block(exarg_T *eap, char_u *p, char_u **tofree, int *flags)
|
|||||||
emsg(_(e_missing_rcurly));
|
emsg(_(e_missing_rcurly));
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
if (ga_add_string(&ga, line) == FAIL)
|
if (ga_copy_string(&ga, line) == FAIL)
|
||||||
break;
|
break;
|
||||||
if (*skipwhite(line) == '}')
|
if (*skipwhite(line) == '}')
|
||||||
break;
|
break;
|
||||||
|
@@ -166,13 +166,13 @@ one_function_arg(
|
|||||||
|
|
||||||
/*
|
/*
|
||||||
* Handle line continuation in function arguments or body.
|
* Handle line continuation in function arguments or body.
|
||||||
* Get a next line, store it in "eap" if appropriate and use "line_to_free" to
|
* Get a next line, store it in "eap" if appropriate and put the line in
|
||||||
* handle freeing the line later.
|
* "lines_to_free" to free the line later.
|
||||||
*/
|
*/
|
||||||
static char_u *
|
static char_u *
|
||||||
get_function_line(
|
get_function_line(
|
||||||
exarg_T *eap,
|
exarg_T *eap,
|
||||||
char_u **line_to_free,
|
garray_T *lines_to_free,
|
||||||
int indent,
|
int indent,
|
||||||
getline_opt_T getline_options)
|
getline_opt_T getline_options)
|
||||||
{
|
{
|
||||||
@@ -184,10 +184,11 @@ get_function_line(
|
|||||||
theline = eap->getline(':', eap->cookie, indent, getline_options);
|
theline = eap->getline(':', eap->cookie, indent, getline_options);
|
||||||
if (theline != NULL)
|
if (theline != NULL)
|
||||||
{
|
{
|
||||||
if (*eap->cmdlinep == *line_to_free)
|
if (lines_to_free->ga_len > 0
|
||||||
|
&& *eap->cmdlinep == ((char_u **)lines_to_free->ga_data)
|
||||||
|
[lines_to_free->ga_len - 1])
|
||||||
*eap->cmdlinep = theline;
|
*eap->cmdlinep = theline;
|
||||||
vim_free(*line_to_free);
|
ga_add_string(lines_to_free, theline);
|
||||||
*line_to_free = theline;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return theline;
|
return theline;
|
||||||
@@ -210,7 +211,7 @@ get_function_args(
|
|||||||
garray_T *default_args,
|
garray_T *default_args,
|
||||||
int skip,
|
int skip,
|
||||||
exarg_T *eap,
|
exarg_T *eap,
|
||||||
char_u **line_to_free)
|
garray_T *lines_to_free)
|
||||||
{
|
{
|
||||||
int mustend = FALSE;
|
int mustend = FALSE;
|
||||||
char_u *arg;
|
char_u *arg;
|
||||||
@@ -241,7 +242,7 @@ get_function_args(
|
|||||||
&& (*p == NUL || (VIM_ISWHITE(*whitep) && *p == '#')))
|
&& (*p == NUL || (VIM_ISWHITE(*whitep) && *p == '#')))
|
||||||
{
|
{
|
||||||
// End of the line, get the next one.
|
// End of the line, get the next one.
|
||||||
char_u *theline = get_function_line(eap, line_to_free, 0,
|
char_u *theline = get_function_line(eap, lines_to_free, 0,
|
||||||
GETLINE_CONCAT_CONT);
|
GETLINE_CONCAT_CONT);
|
||||||
|
|
||||||
if (theline == NULL)
|
if (theline == NULL)
|
||||||
@@ -677,7 +678,7 @@ get_function_body(
|
|||||||
exarg_T *eap,
|
exarg_T *eap,
|
||||||
garray_T *newlines,
|
garray_T *newlines,
|
||||||
char_u *line_arg_in,
|
char_u *line_arg_in,
|
||||||
char_u **line_to_free)
|
garray_T *lines_to_free)
|
||||||
{
|
{
|
||||||
linenr_T sourcing_lnum_top = SOURCING_LNUM;
|
linenr_T sourcing_lnum_top = SOURCING_LNUM;
|
||||||
linenr_T sourcing_lnum_off;
|
linenr_T sourcing_lnum_off;
|
||||||
@@ -744,7 +745,7 @@ get_function_body(
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
theline = get_function_line(eap, line_to_free, indent,
|
theline = get_function_line(eap, lines_to_free, indent,
|
||||||
getline_options);
|
getline_options);
|
||||||
}
|
}
|
||||||
if (KeyTyped)
|
if (KeyTyped)
|
||||||
@@ -854,14 +855,20 @@ get_function_body(
|
|||||||
{
|
{
|
||||||
// Another command follows. If the line came from "eap"
|
// Another command follows. If the line came from "eap"
|
||||||
// we can simply point into it, otherwise we need to
|
// we can simply point into it, otherwise we need to
|
||||||
// change "eap->cmdlinep".
|
// change "eap->cmdlinep" to point to the last fetched
|
||||||
|
// line.
|
||||||
eap->nextcmd = nextcmd;
|
eap->nextcmd = nextcmd;
|
||||||
if (*line_to_free != NULL
|
if (lines_to_free->ga_len > 0
|
||||||
&& *eap->cmdlinep != *line_to_free)
|
&& *eap->cmdlinep !=
|
||||||
|
((char_u **)lines_to_free->ga_data)
|
||||||
|
[lines_to_free->ga_len - 1])
|
||||||
{
|
{
|
||||||
|
// *cmdlinep will be freed later, thus remove the
|
||||||
|
// line from lines_to_free.
|
||||||
vim_free(*eap->cmdlinep);
|
vim_free(*eap->cmdlinep);
|
||||||
*eap->cmdlinep = *line_to_free;
|
*eap->cmdlinep = ((char_u **)lines_to_free->ga_data)
|
||||||
*line_to_free = NULL;
|
[lines_to_free->ga_len - 1];
|
||||||
|
--lines_to_free->ga_len;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@@ -1118,7 +1125,6 @@ lambda_function_body(
|
|||||||
garray_T newlines;
|
garray_T newlines;
|
||||||
char_u *cmdline = NULL;
|
char_u *cmdline = NULL;
|
||||||
int ret = FAIL;
|
int ret = FAIL;
|
||||||
char_u *line_to_free = NULL;
|
|
||||||
partial_T *pt;
|
partial_T *pt;
|
||||||
char_u *name;
|
char_u *name;
|
||||||
int lnum_save = -1;
|
int lnum_save = -1;
|
||||||
@@ -1144,12 +1150,9 @@ lambda_function_body(
|
|||||||
}
|
}
|
||||||
|
|
||||||
ga_init2(&newlines, (int)sizeof(char_u *), 10);
|
ga_init2(&newlines, (int)sizeof(char_u *), 10);
|
||||||
if (get_function_body(&eap, &newlines, NULL, &line_to_free) == FAIL)
|
if (get_function_body(&eap, &newlines, NULL,
|
||||||
{
|
&evalarg->eval_tofree_ga) == FAIL)
|
||||||
if (cmdline != line_to_free)
|
|
||||||
vim_free(cmdline);
|
|
||||||
goto erret;
|
goto erret;
|
||||||
}
|
|
||||||
|
|
||||||
// When inside a lambda must add the function lines to evalarg.eval_ga.
|
// When inside a lambda must add the function lines to evalarg.eval_ga.
|
||||||
evalarg->eval_break_count += newlines.ga_len;
|
evalarg->eval_break_count += newlines.ga_len;
|
||||||
@@ -1208,8 +1211,6 @@ lambda_function_body(
|
|||||||
{
|
{
|
||||||
((char_u **)(tfgap->ga_data))[tfgap->ga_len++] = cmdline;
|
((char_u **)(tfgap->ga_data))[tfgap->ga_len++] = cmdline;
|
||||||
evalarg->eval_using_cmdline = TRUE;
|
evalarg->eval_using_cmdline = TRUE;
|
||||||
if (cmdline == line_to_free)
|
|
||||||
line_to_free = NULL;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@@ -1278,7 +1279,6 @@ lambda_function_body(
|
|||||||
erret:
|
erret:
|
||||||
if (lnum_save >= 0)
|
if (lnum_save >= 0)
|
||||||
SOURCING_LNUM = lnum_save;
|
SOURCING_LNUM = lnum_save;
|
||||||
vim_free(line_to_free);
|
|
||||||
ga_clear_strings(&newlines);
|
ga_clear_strings(&newlines);
|
||||||
if (newargs != NULL)
|
if (newargs != NULL)
|
||||||
ga_clear_strings(newargs);
|
ga_clear_strings(newargs);
|
||||||
@@ -3957,10 +3957,11 @@ list_functions(regmatch_T *regmatch)
|
|||||||
* ":function" also supporting nested ":def".
|
* ":function" also supporting nested ":def".
|
||||||
* When "name_arg" is not NULL this is a nested function, using "name_arg" for
|
* When "name_arg" is not NULL this is a nested function, using "name_arg" for
|
||||||
* the function name.
|
* the function name.
|
||||||
|
* "lines_to_free" is a list of strings to be freed later.
|
||||||
* Returns a pointer to the function or NULL if no function defined.
|
* Returns a pointer to the function or NULL if no function defined.
|
||||||
*/
|
*/
|
||||||
ufunc_T *
|
ufunc_T *
|
||||||
define_function(exarg_T *eap, char_u *name_arg, char_u **line_to_free)
|
define_function(exarg_T *eap, char_u *name_arg, garray_T *lines_to_free)
|
||||||
{
|
{
|
||||||
int j;
|
int j;
|
||||||
int c;
|
int c;
|
||||||
@@ -4229,7 +4230,7 @@ define_function(exarg_T *eap, char_u *name_arg, char_u **line_to_free)
|
|||||||
if (get_function_args(&p, ')', &newargs,
|
if (get_function_args(&p, ')', &newargs,
|
||||||
eap->cmdidx == CMD_def ? &argtypes : NULL, FALSE,
|
eap->cmdidx == CMD_def ? &argtypes : NULL, FALSE,
|
||||||
NULL, &varargs, &default_args, eap->skip,
|
NULL, &varargs, &default_args, eap->skip,
|
||||||
eap, line_to_free) == FAIL)
|
eap, lines_to_free) == FAIL)
|
||||||
goto errret_2;
|
goto errret_2;
|
||||||
whitep = p;
|
whitep = p;
|
||||||
|
|
||||||
@@ -4339,7 +4340,7 @@ define_function(exarg_T *eap, char_u *name_arg, char_u **line_to_free)
|
|||||||
|
|
||||||
// Do not define the function when getting the body fails and when
|
// Do not define the function when getting the body fails and when
|
||||||
// skipping.
|
// skipping.
|
||||||
if (get_function_body(eap, &newlines, line_arg, line_to_free) == FAIL
|
if (get_function_body(eap, &newlines, line_arg, lines_to_free) == FAIL
|
||||||
|| eap->skip)
|
|| eap->skip)
|
||||||
goto erret;
|
goto erret;
|
||||||
|
|
||||||
@@ -4645,10 +4646,11 @@ ret_free:
|
|||||||
void
|
void
|
||||||
ex_function(exarg_T *eap)
|
ex_function(exarg_T *eap)
|
||||||
{
|
{
|
||||||
char_u *line_to_free = NULL;
|
garray_T lines_to_free;
|
||||||
|
|
||||||
(void)define_function(eap, NULL, &line_to_free);
|
ga_init2(&lines_to_free, sizeof(char_u *), 50);
|
||||||
vim_free(line_to_free);
|
(void)define_function(eap, NULL, &lines_to_free);
|
||||||
|
ga_clear_strings(&lines_to_free);
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@@ -750,6 +750,8 @@ static char *(features[]) =
|
|||||||
|
|
||||||
static int included_patches[] =
|
static int included_patches[] =
|
||||||
{ /* Add new patch number below this line */
|
{ /* Add new patch number below this line */
|
||||||
|
/**/
|
||||||
|
4040,
|
||||||
/**/
|
/**/
|
||||||
4039,
|
4039,
|
||||||
/**/
|
/**/
|
||||||
|
@@ -810,7 +810,7 @@ func_needs_compiling(ufunc_T *ufunc, compiletype_T compile_type)
|
|||||||
* Compile a nested :def command.
|
* Compile a nested :def command.
|
||||||
*/
|
*/
|
||||||
static char_u *
|
static char_u *
|
||||||
compile_nested_function(exarg_T *eap, cctx_T *cctx, char_u **line_to_free)
|
compile_nested_function(exarg_T *eap, cctx_T *cctx, garray_T *lines_to_free)
|
||||||
{
|
{
|
||||||
int is_global = *eap->arg == 'g' && eap->arg[1] == ':';
|
int is_global = *eap->arg == 'g' && eap->arg[1] == ':';
|
||||||
char_u *name_start = eap->arg;
|
char_u *name_start = eap->arg;
|
||||||
@@ -876,7 +876,7 @@ compile_nested_function(exarg_T *eap, cctx_T *cctx, char_u **line_to_free)
|
|||||||
goto theend;
|
goto theend;
|
||||||
}
|
}
|
||||||
|
|
||||||
ufunc = define_function(eap, lambda_name, line_to_free);
|
ufunc = define_function(eap, lambda_name, lines_to_free);
|
||||||
if (ufunc == NULL)
|
if (ufunc == NULL)
|
||||||
{
|
{
|
||||||
r = eap->skip ? OK : FAIL;
|
r = eap->skip ? OK : FAIL;
|
||||||
@@ -2496,7 +2496,7 @@ compile_def_function(
|
|||||||
cctx_T *outer_cctx)
|
cctx_T *outer_cctx)
|
||||||
{
|
{
|
||||||
char_u *line = NULL;
|
char_u *line = NULL;
|
||||||
char_u *line_to_free = NULL;
|
garray_T lines_to_free;
|
||||||
char_u *p;
|
char_u *p;
|
||||||
char *errormsg = NULL; // error message
|
char *errormsg = NULL; // error message
|
||||||
cctx_T cctx;
|
cctx_T cctx;
|
||||||
@@ -2514,6 +2514,9 @@ compile_def_function(
|
|||||||
#endif
|
#endif
|
||||||
int debug_lnum = -1;
|
int debug_lnum = -1;
|
||||||
|
|
||||||
|
// allocated lines are freed at the end
|
||||||
|
ga_init2(&lines_to_free, sizeof(char_u *), 50);
|
||||||
|
|
||||||
// When using a function that was compiled before: Free old instructions.
|
// When using a function that was compiled before: Free old instructions.
|
||||||
// The index is reused. Otherwise add a new entry in "def_functions".
|
// The index is reused. Otherwise add a new entry in "def_functions".
|
||||||
if (ufunc->uf_dfunc_idx > 0)
|
if (ufunc->uf_dfunc_idx > 0)
|
||||||
@@ -2681,8 +2684,8 @@ compile_def_function(
|
|||||||
if (line != NULL)
|
if (line != NULL)
|
||||||
{
|
{
|
||||||
line = vim_strsave(line);
|
line = vim_strsave(line);
|
||||||
vim_free(line_to_free);
|
if (ga_add_string(&lines_to_free, line) == FAIL)
|
||||||
line_to_free = line;
|
goto erret;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -2926,7 +2929,7 @@ compile_def_function(
|
|||||||
case CMD_def:
|
case CMD_def:
|
||||||
case CMD_function:
|
case CMD_function:
|
||||||
ea.arg = p;
|
ea.arg = p;
|
||||||
line = compile_nested_function(&ea, &cctx, &line_to_free);
|
line = compile_nested_function(&ea, &cctx, &lines_to_free);
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case CMD_return:
|
case CMD_return:
|
||||||
@@ -3236,7 +3239,7 @@ erret:
|
|||||||
if (do_estack_push)
|
if (do_estack_push)
|
||||||
estack_pop();
|
estack_pop();
|
||||||
|
|
||||||
vim_free(line_to_free);
|
ga_clear_strings(&lines_to_free);
|
||||||
free_imported(&cctx);
|
free_imported(&cctx);
|
||||||
free_locals(&cctx);
|
free_locals(&cctx);
|
||||||
ga_clear(&cctx.ctx_type_stack);
|
ga_clear(&cctx.ctx_type_stack);
|
||||||
|
@@ -2730,7 +2730,7 @@ read_viminfo_barline(vir_T *virp, int got_encoding, int force, int writing)
|
|||||||
{
|
{
|
||||||
// Continuation line of an unrecognized item.
|
// Continuation line of an unrecognized item.
|
||||||
if (writing)
|
if (writing)
|
||||||
ga_add_string(&virp->vir_barlines, virp->vir_line);
|
ga_copy_string(&virp->vir_barlines, virp->vir_line);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@@ -2769,7 +2769,7 @@ read_viminfo_barline(vir_T *virp, int got_encoding, int force, int writing)
|
|||||||
default:
|
default:
|
||||||
// copy unrecognized line (for future use)
|
// copy unrecognized line (for future use)
|
||||||
if (writing)
|
if (writing)
|
||||||
ga_add_string(&virp->vir_barlines, virp->vir_line);
|
ga_copy_string(&virp->vir_barlines, virp->vir_line);
|
||||||
}
|
}
|
||||||
for (i = 0; i < values.ga_len; ++i)
|
for (i = 0; i < values.ga_len; ++i)
|
||||||
{
|
{
|
||||||
|
Reference in New Issue
Block a user