feedback: replace an assert with a check plus error message at startup
parent
f585403b36
commit
408f15954e
|
@ -1130,6 +1130,9 @@ void parse_rcfile(FILE *rcstream, bool syntax_only)
|
||||||
if (has_blank_char(option)) {
|
if (has_blank_char(option)) {
|
||||||
rcfile_error(N_("Non-blank characters required"));
|
rcfile_error(N_("Non-blank characters required"));
|
||||||
free(option);
|
free(option);
|
||||||
|
} else if (mbstrlen(option) % 2 != 0) {
|
||||||
|
rcfile_error(N_("Even number of characters required"));
|
||||||
|
free(option);
|
||||||
} else
|
} else
|
||||||
matchbrackets = option;
|
matchbrackets = option;
|
||||||
} else if (strcasecmp(rcopts[i].name, "whitespace") == 0) {
|
} else if (strcasecmp(rcopts[i].name, "whitespace") == 0) {
|
||||||
|
|
|
@ -943,8 +943,6 @@ void do_find_bracket(void)
|
||||||
bool reverse;
|
bool reverse;
|
||||||
/* The direction we search. */
|
/* The direction we search. */
|
||||||
|
|
||||||
assert(mbstrlen(matchbrackets) % 2 == 0);
|
|
||||||
|
|
||||||
ch = mbstrchr(matchbrackets, openfile->current->data + openfile->current_x);
|
ch = mbstrchr(matchbrackets, openfile->current->data + openfile->current_x);
|
||||||
|
|
||||||
if (ch == NULL) {
|
if (ch == NULL) {
|
||||||
|
|
Loading…
Reference in New Issue