nano

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

commit 9cc32c920b5c7ac1a80832ac6a5c1e6f42be057b
parent 72ad00f9d02aec94816deb3d4d3abd2c4b751a44
Author: Benno Schulenberg <bensberg@telfort.nl>
Date:   Tue,  3 Mar 2020 10:45:02 +0100

rcfile: when finding a mistake, skip the rest of the line

Diffstat:
Msrc/rcfile.c | 13++++++-------
1 file changed, 6 insertions(+), 7 deletions(-)

diff --git a/src/rcfile.c b/src/rcfile.c @@ -1066,14 +1066,13 @@ void parse_colors(char *ptr, int rex_flags) if (*ptr != '"') { jot_error(N_("Regex strings must begin and end with a \" character")); - ptr = parse_next_regex(ptr); - continue; + return; } item = ++ptr; ptr = parse_next_regex(ptr); if (ptr == NULL) - break; + return; if (*item == '\0') { jot_error(N_("Empty regex string")); @@ -1113,22 +1112,22 @@ void parse_colors(char *ptr, int rex_flags) ptr += 4; if (*ptr != '"') { jot_error(N_("Regex strings must begin and end with a \" character")); - continue; + return; } item = ++ptr; ptr = parse_next_regex(ptr); if (ptr == NULL) - break; + return; if (*item == '\0') { jot_error(N_("Empty regex string")); - continue; + return; } /* If the start regex was invalid, the end regex cannot be saved. */ if (!goodstart) - continue; + return; /* Save the compiled ending regex (when it's valid). */ compile(item, rex_flags, &newcolor->end);