From: David Lawrence Ramsey Date: Fri, 14 Apr 2006 17:20:53 +0000 (+0000) Subject: in parse_syntax(), properly generate an error if we've read in a X-Git-Tag: v1.3.12~301 X-Git-Url: https://git.wh0rd.org/?a=commitdiff_plain;h=a33ec1deff62412106fcc83abd6b5ad8187113cf;p=nano.git in parse_syntax(), properly generate an error if we've read in a previous syntax without any associated color commands git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@3377 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- diff --git a/ChangeLog b/ChangeLog index 5fd3f9a8..8aaf2f45 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 a3768bc0..4a1a5ecd 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;