summaryrefslogtreecommitdiffstats
path: root/color.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>1998-06-16 15:02:09 +0000
committerThomas Roessler <roessler@does-not-exist.org>1998-06-16 15:02:09 +0000
commitfb0e96b4ceae3d34b2eb8163aa328950d2510db1 (patch)
treefee0c792adb343995c792f4fe57cb47a8aa1acd2 /color.c
parentd1a559cc2326057d43f9aafa0bb81103cda32c4b (diff)
Fix the "unknown color" bug reported by Vikas.
Diffstat (limited to 'color.c')
-rw-r--r--color.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/color.c b/color.c
index 6468b2e3..66bcd8b3 100644
--- a/color.c
+++ b/color.c
@@ -347,7 +347,8 @@ parse_color_name (const char *s, int *col, int *attr, int brite, BUFFER *err)
{
s += 5;
*col = strtol (s, &eptr, 10);
- if (!*s || *eptr || *col < 0 || *col >= COLORS)
+ if (!*s || *eptr || *col < 0 ||
+ (*col >= COLORS && !option(OPTNOCURSES) && has_colors()))
{
snprintf (err->data, err->dsize, "%s: color not supported by term", s);
return (-1);