summaryrefslogtreecommitdiff
path: root/Src/prompt.c
diff options
context:
space:
mode:
authorOliver Kiddle <okiddle@yahoo.co.uk>2018-11-08 11:01:36 +0100
committerOliver Kiddle <okiddle@yahoo.co.uk>2018-11-08 11:01:36 +0100
commit5a7070178826e7b0db94e0a3d285849315e5c5ab (patch)
treea591eb8b149de6854c0e877d87878c4f4096e3fa /Src/prompt.c
parent9eba4d3a4417ce0e4e8d138376e86d831a889936 (diff)
downloadzsh-5a7070178826e7b0db94e0a3d285849315e5c5ab.tar.gz
zsh-5a7070178826e7b0db94e0a3d285849315e5c5ab.zip
43805: make nearcolor module use the default colour rather than black as a fallback
Diffstat (limited to 'Src/prompt.c')
-rw-r--r--Src/prompt.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/Src/prompt.c b/Src/prompt.c
index 377015ad8..568bfc2a9 100644
--- a/Src/prompt.c
+++ b/Src/prompt.c
@@ -1650,10 +1650,12 @@ match_colour(const char **teststrp, int is_fg, int colour)
return TXT_ERROR;
*teststrp = end;
colour = runhookdef(GETCOLORATTR, &color) - 1;
- if (colour < 0) { /* no hook function added, try true color (24-bit) */
+ if (colour == -1) { /* no hook function added, try true color (24-bit) */
colour = (((color.red << 8) + color.green) << 8) + color.blue;
return on | (is_fg ? TXT_ATTR_FG_24BIT : TXT_ATTR_BG_24BIT) |
(zattr)colour << shft;
+ } else if (colour <= -2) {
+ return TXT_ERROR;
}
} else if ((named = ialpha(**teststrp))) {
colour = match_named_colour(teststrp);