Allow uppercase letters in gray/grey color names, GitHub issue 4560 from

Pavel Roskin.
This commit is contained in:
nicm
2025-07-17 11:39:23 +00:00
parent e6bac234db
commit 041bbf8bdf

View File

@ -986,7 +986,8 @@ colour_byname(const char *name)
int c;
const char *errstr;
if (strncmp(name, "grey", 4) == 0 || strncmp(name, "gray", 4) == 0) {
if (strncasecmp(name, "grey", 4) == 0 ||
strncasecmp(name, "gray", 4) == 0) {
if (name[4] == '\0')
return (0xbebebe|COLOUR_FLAG_RGB);
c = strtonum(name + 4, 0, 100, &errstr);