diff --git a/ChangeLog b/ChangeLog index 5fd3f9a871e2be38764aa55292927ecc7e223734..8aaf2f451ee5294fcab4be1e95deca8f05d9918e 100644 --- a/ChangeLog +++ b/ChangeLog @@ -56,6 +56,9 @@ CVS code - - rcfile.c: parse_argument() - Rename variable ptr_bak to ptr_save, for consistency. (DLR) + parse_syntax() + - Properly generate an error if we've read in a previous syntax + without any associated color commands. (DLR) parse_colors() - Check for a color command's not following a syntax line before anything else. (DLR) diff --git a/src/rcfile.c b/src/rcfile.c index a3768bc068679d76165cb1d09283d5eae82aca8e..4a1a5ecd9909d81572c472dd83ff2ba06b725685 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -282,6 +282,11 @@ void parse_syntax(char *ptr) assert(ptr != NULL); + if (endsyntax != NULL && endcolor == NULL) { + rcfile_error(N_("Previous syntax has no color commands")); + return; + } + if (*ptr == '\0') { rcfile_error(N_("Missing syntax name")); return;