mirror of
git://git.sv.gnu.org/nano.git
synced 2025-02-27 13:24:03 +03:00
tweaks: make an assignment only when the option is valid, like elsewhere
This commit is contained in:
parent
01e6d435fe
commit
23190aa60f
16
src/rcfile.c
16
src/rcfile.c
@ -1128,19 +1128,17 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
||||
free(option);
|
||||
}
|
||||
if (strcasecmp(rcopts[i].name, "matchbrackets") == 0) {
|
||||
matchbrackets = option;
|
||||
if (has_blank_char(matchbrackets)) {
|
||||
if (has_blank_char(option)) {
|
||||
rcfile_error(N_("Non-blank characters required"));
|
||||
free(matchbrackets);
|
||||
matchbrackets = NULL;
|
||||
}
|
||||
free(option);
|
||||
} else
|
||||
matchbrackets = option;
|
||||
} else if (strcasecmp(rcopts[i].name, "whitespace") == 0) {
|
||||
whitespace = option;
|
||||
if (mbstrlen(whitespace) != 2 || strlenpt(whitespace) != 2) {
|
||||
if (mbstrlen(option) != 2 || strlenpt(option) != 2) {
|
||||
rcfile_error(N_("Two single-column characters required"));
|
||||
free(whitespace);
|
||||
whitespace = NULL;
|
||||
free(option);
|
||||
} else {
|
||||
whitespace = option;
|
||||
whitespace_len[0] = parse_mbchar(whitespace, NULL, NULL);
|
||||
whitespace_len[1] = parse_mbchar(whitespace +
|
||||
whitespace_len[0], NULL, NULL);
|
||||
|
Loading…
x
Reference in New Issue
Block a user