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.
master
Benno Schulenberg 2020-08-19 16:17:07 +02:00
parent 71752f47cb
commit 68d71f649e
1 changed files with 3 additions and 2 deletions

View File

@ -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. */ * vivid to TRUE for a lighter color, and thick for a heavier typeface. */
short color_to_short(const char *colorname, bool *vivid, bool *thick) 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; *vivid = TRUE;
*thick = TRUE; *thick = TRUE;
colorname += 6; colorname += 6;
} else if (strncmp(colorname, "light", 5) == 0) { } else if (strncmp(colorname, "light", 5) == 0 && colorname[5] != '\0') {
*vivid = TRUE; *vivid = TRUE;
*thick = FALSE; *thick = FALSE;
colorname += 5; colorname += 5;