rcfile: close off a syntax when a non-syntax command is encountered

The 'color' commands of a syntax definition should not be allowed to
be interspersed with other, non-syntax commands.

This fixes https://savannah.gnu.org/bugs/?56498.

Bug existed since before version 2.6.0.
master
Benno Schulenberg 2019-06-15 15:07:57 +02:00
parent 4e14a8a977
commit 0af9ce926b
1 changed files with 8 additions and 0 deletions

View File

@ -379,6 +379,10 @@ void parse_binding(char *ptr, bool dobind)
int menu, mask = 0; int menu, mask = 0;
funcstruct *f; funcstruct *f;
#ifdef ENABLE_COLOR
opensyntax = FALSE;
#endif
if (*ptr == '\0') { if (*ptr == '\0') {
jot_error(N_("Missing key name")); jot_error(N_("Missing key name"));
return; return;
@ -1107,6 +1111,10 @@ void parse_rcfile(FILE *rcstream, bool just_syntax, bool intros_only)
if (set == 0) if (set == 0)
continue; continue;
#ifdef ENABLE_COLOR
opensyntax = FALSE;
#endif
if (*ptr == '\0') { if (*ptr == '\0') {
jot_error(N_("Missing option")); jot_error(N_("Missing option"));
continue; continue;