From 9cc32c920b5c7ac1a80832ac6a5c1e6f42be057b Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Tue, 3 Mar 2020 10:45:02 +0100 Subject: [PATCH] rcfile: when finding a mistake, skip the rest of the line --- src/rcfile.c | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/src/rcfile.c b/src/rcfile.c index 6ff06523..88f12d7e 100644 --- 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);