forked from aniani/vim
patch 9.0.2126: unused assignments when checking 'listchars'
Problem: Unused assignments when checking the value of 'listchars'. Solution: Loop only once when just checking the value. Add a test to check that this change doesn't cause double-free. closes: #13559 Signed-off-by: zeertzjq <zeertzjq@outlook.com> Signed-off-by: Christian Brabandt <cb@256bit.org>
This commit is contained in:
committed by
Christian Brabandt
parent
40ed6711bd
commit
00624a2fa0
@@ -4726,7 +4726,7 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply)
|
||||
}
|
||||
|
||||
// first round: check for valid value, second round: assign values
|
||||
for (round = 0; round <= 1; ++round)
|
||||
for (round = 0; round <= (apply ? 1 : 0); ++round)
|
||||
{
|
||||
if (round > 0)
|
||||
{
|
||||
@@ -4913,11 +4913,6 @@ set_chars_option(win_T *wp, char_u *value, int is_listchars, int apply)
|
||||
wp->w_fill_chars = fill_chars;
|
||||
}
|
||||
}
|
||||
else if (is_listchars)
|
||||
{
|
||||
vim_free(lcs_chars.multispace);
|
||||
vim_free(lcs_chars.leadmultispace);
|
||||
}
|
||||
|
||||
return NULL; // no error
|
||||
}
|
||||
|
Reference in New Issue
Block a user