about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog3
-rw-r--r--Src/Modules/curses.c4
2 files changed, 7 insertions, 0 deletions
diff --git a/ChangeLog b/ChangeLog
index 17af1c099..b32a3bfdb 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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>
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;