nano

nano with my custom patches
git clone git://bsandro.tech/nano
Log | Files | Refs | README | LICENSE

commit 408f15954e9d36ea7dfe9f85dae845b4ed5780c4
parent f585403b364fc9fa243c5dc0ebfef5399331e600
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Sat,  6 Apr 2019 10:03:52 +0200

feedback: replace an assert with a check plus error message at startup

Diffstat:
Msrc/rcfile.c | 3+++
Msrc/search.c | 2--
2 files changed, 3 insertions(+), 2 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -1130,6 +1130,9 @@ void parse_rcfile(FILE *rcstream, bool syntax_only) if (has_blank_char(option)) { rcfile_error(N_("Non-blank characters required")); free(option); + } else if (mbstrlen(option) % 2 != 0) { + rcfile_error(N_("Even number of characters required")); + free(option); } else matchbrackets = option; } else if (strcasecmp(rcopts[i].name, "whitespace") == 0) { diff --git a/src/search.c b/src/search.c @@ -943,8 +943,6 @@ void do_find_bracket(void) bool reverse; /* The direction we search. */ - assert(mbstrlen(matchbrackets) % 2 == 0); - ch = mbstrchr(matchbrackets, openfile->current->data + openfile->current_x); if (ch == NULL) {