From a5b64f6c919a736b0d4cf0043a782b87c9d08a57 Mon Sep 17 00:00:00 2001 From: Vincent Lefevre Date: Sat, 29 Dec 2018 20:08:26 +0100 Subject: [PATCH] Light colors: do not do the + 8 on negative values, such as COLOR_DEFAULT. --- color.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/color.c b/color.c index 892155a1..35318600 100644 --- a/color.c +++ b/color.c @@ -368,7 +368,7 @@ parse_color_name (const char *s, int *col, int *attr, int is_fg, BUFFER *err) { if ((COLORS >= 16) && is_light) { - if (*col < 8) + if (*col >= 0 && *col <= 7) { /* Advance the color 0-7 by 8 to get the light version */ *col += 8; @@ -383,7 +383,7 @@ parse_color_name (const char *s, int *col, int *attr, int is_fg, BUFFER *err) { if (COLORS >= 16) { - if (*col < 8) + if (*col >= 0 && *col <= 7) { /* Advance the color 0-7 by 8 to get the light version */ *col += 8; -- 2.40.0