1
0
Fork 0
mirror of git://git.code.sf.net/p/zsh/code synced 2025-09-30 07:10:58 +02:00

fix crash when colo[u]r is not available in curses

This commit is contained in:
Peter Stephenson 2007-10-29 11:38:13 +00:00
parent d18abd1203
commit 8fe09747d8
2 changed files with 7 additions and 0 deletions

View file

@ -1,5 +1,8 @@
2007-10-29 Peter Stephenson <pws@csr.com>
* 24029: Src/Modules/curses.c: crashed on attempt to use
color if it wasn't available.
* unposted: configure.ac: remove some broken debugging.
2007-10-28 Peter Stephenson <p.w.stephenson@ntlworld.com>

View file

@ -268,6 +268,10 @@ zcurses_colorset(const char *nam, WINDOW *w, char *colorpair)
short f, b;
Colorpairnode cpn;
/* zcurses_colorpairs is only initialised if color is supported */
if (!zcurses_colorpairs)
return 1;
if (zc_color_phase==1 ||
!(cpn = (Colorpairnode) gethashnode(zcurses_colorpairs, colorpair))) {
zc_color_phase = 2;