From 91b2d2124f5b9d8c0dae77ca1f1da33650b625da Mon Sep 17 00:00:00 2001 From: William McBrine Date: Tue, 21 Feb 2006 17:20:17 +0000 Subject: [PATCH] COLOR_PAIR() should & with A_COLOR, not A_ATTRIBUTES. --- curses.h | 5 ++--- pdcurses/color.c | 4 ++-- 2 files changed, 4 insertions(+), 5 deletions(-) diff --git a/curses.h b/curses.h index 6ad5ffa9..5e610a97 100644 --- a/curses.h +++ b/curses.h @@ -15,7 +15,7 @@ * See the file maintain.er for details of the current maintainer. **************************************************************************/ -/* $Id: curses.h,v 1.129 2006/02/21 07:05:43 wmcbrine Exp $ */ +/* $Id: curses.h,v 1.130 2006/02/21 17:20:17 wmcbrine Exp $ */ /* ---------------------------------------------------------------------- PDCurses @@ -1557,8 +1557,7 @@ int PDC_set_line_color(short); #if !defined(NOMACROS) && !defined(PDCDEBUG) -#define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) &\ - A_ATTRIBUTES) +#define COLOR_PAIR(n) (((chtype)(n) << PDC_COLOR_SHIFT) & A_COLOR) #define PAIR_NUMBER(n) (((n) & A_COLOR) >> PDC_COLOR_SHIFT) # define addch(c) waddch(stdscr, c) diff --git a/pdcurses/color.c b/pdcurses/color.c index 27d9f55f..1a2c6f84 100644 --- a/pdcurses/color.c +++ b/pdcurses/color.c @@ -35,7 +35,7 @@ static void PDC_init_pair(short, short, short); #ifdef PDCDEBUG const char *rcsid_color = - "$Id: color.c,v 1.39 2006/02/21 07:05:43 wmcbrine Exp $"; + "$Id: color.c,v 1.40 2006/02/21 17:20:17 wmcbrine Exp $"; #endif /*man-start********************************************************************* @@ -133,7 +133,7 @@ unsigned char colorset[PDC_COLOR_PAIRS]; chtype COLOR_PAIR(int n) { - return ((chtype)n << PDC_COLOR_SHIFT) & A_ATTRIBUTES; + return ((chtype)n << PDC_COLOR_SHIFT) & A_COLOR; } int PAIR_NUMBER(chtype value)