rcfile: when finding a mistake, skip the rest of the line
parent
72ad00f9d0
commit
9cc32c920b
13
src/rcfile.c
13
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);
|
||||
|
|
Loading…
Reference in New Issue