mirror of
git://git.code.sf.net/p/zsh/code
synced 2025-10-25 05:10:28 +02:00
39354: zcurses fix for colour management
Alter internal return code so as not to mask curses error code.
This commit is contained in:
parent
5ee05cf935
commit
7fc0c2d57d
2 changed files with 9 additions and 4 deletions
|
|
@ -324,7 +324,7 @@ zcurses_color(const char *color)
|
|||
return (short)zc->number;
|
||||
}
|
||||
|
||||
return (short)-1;
|
||||
return (short)-2;
|
||||
}
|
||||
|
||||
static Colorpairnode
|
||||
|
|
@ -353,10 +353,10 @@ zcurses_colorget(const char *nam, char *colorpair)
|
|||
f = zcurses_color(cp);
|
||||
b = zcurses_color(bg+1);
|
||||
|
||||
if (f==-1 || b==-1) {
|
||||
if (f == -1)
|
||||
if (f==-2 || b==-2) {
|
||||
if (f == -2)
|
||||
zwarnnam(nam, "foreground color `%s' not known", cp);
|
||||
if (b == -1)
|
||||
if (b == -2)
|
||||
zwarnnam(nam, "background color `%s' not known", bg+1);
|
||||
*bg = '/';
|
||||
zsfree(cp);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue