Some SETCOLOR's were being used without checking if the user had set the
colour, first.
If the user set the "normal" colours, then SETCOLOR would leave blocks
of unexpected colours.
Fixes #610
* right column.
*/
#ifdef HAVE_BKGDSET
-#define SETCOLOR(X) bkgdset(ColorDefs[X] | ' ')
+#define SETCOLOR(X) \
+ do \
+ { \
+ if (ColorDefs[X] != 0) \
+ bkgdset(ColorDefs[X] | ' '); \
+ } while (0)
#define ATTRSET(X) bkgdset(X | ' ')
#else
-#define SETCOLOR(X) attrset(ColorDefs[X])
+#define SETCOLOR(X) \
+ do \
+ { \
+ if (ColorDefs[X] != 0) \
+ attrset(ColorDefs[X]); \
+ } while (0)
#define ATTRSET attrset
#endif