From 20fcdcfea1651d26990ae482cbc0f3594c4cea54 Mon Sep 17 00:00:00 2001 From: nicm Date: Tue, 25 Aug 2020 11:35:32 +0000 Subject: Allow colour to be spelt as color, from Boris Verkhovsky. GitHub issue 2317. --- colour.c | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'colour.c') diff --git a/colour.c b/colour.c index c7972878..ee4b95db 100644 --- a/colour.c +++ b/colour.c @@ -189,6 +189,12 @@ colour_fromstring(const char *s) return (-1); return (n | COLOUR_FLAG_256); } + if (strncasecmp(s, "color", (sizeof "color") - 1) == 0) { + n = strtonum(s + (sizeof "color") - 1, 0, 255, &errstr); + if (errstr != NULL) + return (-1); + return (n | COLOUR_FLAG_256); + } if (strcasecmp(s, "default") == 0) return (8); -- cgit