>From 2d8312d4a3656714fd7597eb9e065dbbc1118874 Mon Sep 17 00:00:00 2001 From: Brand Huntsman Date: Fri, 2 Mar 2018 17:37:54 -0700 Subject: [PATCH 3/5] ignore regex if invalid background color Prevents "black,redd" from causing invisible text when default background is black. Signed-off-by: Brand Huntsman --- src/rcfile.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/rcfile.c b/src/rcfile.c index 3fb3948a..7134feca 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -786,6 +786,10 @@ bool parse_color_names(char *combostr, short *fg, short *bg, int *attributes) if (word != NULL && *word != '\0') { *bg = color_to_short(word, &bright); + /* If the specified background color is bad, ignore the regexes. */ + if (*bg == -1) + return FALSE; + if (bright) { rcfile_error(N_("A background color cannot be bright")); return FALSE; -- 2.16.1