commit 68d71f649e642662959d1111d6c6a4ce3c556717
parent 71752f47cbede94345ed810db41cac6cf914957a
Author: Benno Schulenberg <bensberg@telfort.nl>
Date: Wed, 19 Aug 2020 16:17:07 +0200
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.
Diffstat:
1 file changed, 3 insertions(+), 2 deletions(-)
diff --git 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;