vim-patch:9.0.2126: unused assignments when checking 'listchars' (#26182)

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: vim/vim#13559

00624a2fa0
This commit is contained in:
zeertzjq
2023-11-24 06:52:50 +08:00
committed by GitHub
parent 9510346141
commit fe94e04893
2 changed files with 5 additions and 3 deletions

View File

@@ -2871,9 +2871,6 @@ static const char *set_chars_option(win_T *wp, const char *value, const bool is_
} else {
wp->w_p_fcs_chars = fcs_chars;
}
} else if (is_listchars) {
xfree(lcs_chars.multispace);
xfree(lcs_chars.leadmultispace);
}
return NULL; // no error