From 17ec14b9a53ce66487bd456fdaba9d5ee290c2f4 Mon Sep 17 00:00:00 2001 From: Chris Allegretta Date: Fri, 7 Feb 2003 00:19:05 +0000 Subject: [PATCH] Better fix hopefully for color issue git-svn-id: svn://svn.savannah.gnu.org/nano/trunk/nano@1430 35c25a1d-7b9e-4130-9fde-d3aeb78583b8 --- ChangeLog | 3 ++- rcfile.c | 4 ++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index 89d3745b..f5d94187 100644 --- a/ChangeLog +++ b/ChangeLog @@ -11,7 +11,8 @@ CVS code colortoint() - Don't bomb after invalid color and print bad color name (David Benbennick). - - And reset mcolor to -1. + colortoint, parse_colors() + - Don't add strings with invalid fg colors at all. - nano.1, nano.1.html: - Add initialization file comments, change some options from bracketed to underlined to emphasize that they are not diff --git a/rcfile.c b/rcfile.c index dade1c43..03f5dfee 100644 --- a/rcfile.c +++ b/rcfile.c @@ -361,6 +361,10 @@ void parse_colors(char *ptr) fg = colortoint(fgstr, &bright); + /* Don't try and parse screwed up fg colors */ + if (fg == -1) + return; + if (syntaxes == NULL) { rcfile_error(_("Cannot add a color directive without a syntax line")); return;