about summary refs log tree commit diff
path: root/Src
diff options
context:
space:
mode:
authorPeter Stephenson <pws@users.sourceforge.net>2007-10-29 11:38:13 +0000
committerPeter Stephenson <pws@users.sourceforge.net>2007-10-29 11:38:13 +0000
commit8fe09747d8f8036dfd3d13aa701bbbc5d530afce (patch)
treedfb3b5760e85298347312e3f01e89a44412a33c5 /Src
parentd18abd120358d5bc89a837b546ebab01f3a74b1e (diff)
downloadzsh-8fe09747d8f8036dfd3d13aa701bbbc5d530afce.tar.gz
zsh-8fe09747d8f8036dfd3d13aa701bbbc5d530afce.tar.xz
zsh-8fe09747d8f8036dfd3d13aa701bbbc5d530afce.zip
fix crash when colo[u]r is not available in curses
Diffstat (limited to 'Src')
-rw-r--r--Src/Modules/curses.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/Src/Modules/curses.c b/Src/Modules/curses.c
index 063ac9014..a1801e913 100644
--- a/Src/Modules/curses.c
+++ b/Src/Modules/curses.c
@@ -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;