summaryrefslogtreecommitdiff
path: root/Src/Zle/complist.c
diff options
context:
space:
mode:
authorAxel Beckert <abe@deuxchevaux.org>2018-12-24 04:40:22 +0100
committerAxel Beckert <abe@deuxchevaux.org>2018-12-24 04:40:22 +0100
commitbf8b7f713a5b04a191f4596fb86bbbfca0a855ce (patch)
treeb647a8dc990c8c845b8a8eca7bf92fbbf17e1fb5 /Src/Zle/complist.c
parent06946d431a4426c6e5dffec1d7edb17c1dbd467c (diff)
parent9dbde9e9c7d22ee0d301e4a2fecf97906d1ddce9 (diff)
downloadzsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.tar.gz
zsh-bf8b7f713a5b04a191f4596fb86bbbfca0a855ce.zip
New upstream release candidate 5.6.2-test-2
Merge branch 'upstream' at 'zsh-5.6.2-test-2' into branch debian
Diffstat (limited to 'Src/Zle/complist.c')
-rw-r--r--Src/Zle/complist.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/Src/Zle/complist.c b/Src/Zle/complist.c
index e768aee5d..429c8159f 100644
--- a/Src/Zle/complist.c
+++ b/Src/Zle/complist.c
@@ -1096,6 +1096,7 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
p += len;
if (*p) {
int arg = 0, is_fg;
+ zattr atr;
if (idigit(*p))
arg = zstrtol(p, &p, 10);
@@ -1159,13 +1160,13 @@ compprintfmt(char *fmt, int n, int dopr, int doesc, int ml, int *stop)
/* colours must be ASCII */
if (*p == '{') {
p++;
- arg = match_colour((const char **)&p, is_fg, 0);
+ atr = match_colour((const char **)&p, is_fg, 0);
if (*p == '}')
p++;
} else
- arg = match_colour(NULL, is_fg, arg);
- if (arg >= 0 && dopr)
- set_colour_attribute(arg, is_fg ? COL_SEQ_FG :
+ atr = match_colour(NULL, is_fg, arg);
+ if (atr != TXT_ERROR && dopr)
+ set_colour_attribute(atr, is_fg ? COL_SEQ_FG :
COL_SEQ_BG, 0);
break;
case ZWC('f'):