From 68d71f649e642662959d1111d6c6a4ce3c556717 Mon Sep 17 00:00:00 2001 From: Benno Schulenberg Date: Wed, 19 Aug 2020 16:17:07 +0200 Subject: [PATCH] rcfile: make sure that "bright"/"light" are prefixes, not separate words This fixes https://savannah.gnu.org/bugs/?58984. The bug was old -- it existed since at least version 2.0.6. --- src/rcfile.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/rcfile.c b/src/rcfile.c index d848f4d0..c259cc7d 100644 --- a/src/rcfile.c +++ b/src/rcfile.c @@ -996,11 +996,12 @@ short indices[9] = { 204, 163, 134, 38, 48, 148, 215, 208, 137 }; * vivid to TRUE for a lighter color, and thick for a heavier typeface. */ short color_to_short(const char *colorname, bool *vivid, bool *thick) { - if (strncmp(colorname, "bright", 6) == 0) { /* Deprecated; remove in 2023. */ + if (strncmp(colorname, "bright", 6) == 0 && colorname[6] != '\0') { + /* Prefix "bright" is deprecated; remove in 2024. */ *vivid = TRUE; *thick = TRUE; colorname += 6; - } else if (strncmp(colorname, "light", 5) == 0) { + } else if (strncmp(colorname, "light", 5) == 0 && colorname[5] != '\0') { *vivid = TRUE; *thick = FALSE; colorname += 5;