#endif
-MODULE_ID("$Id: new_pair.c,v 1.15 2018/03/01 15:02:12 tom Exp $")
+MODULE_ID("$Id: new_pair.c,v 1.17 2018/12/29 21:27:21 tom Exp $")
#if NCURSES_EXT_COLORS
{
colorpair_t *last;
if (ValidPair(sp, pair)) {
- last = _nc_reserve_pairs(sp, pair);
+ ReservePairs(sp, pair);
+ last = &(sp->_color_pairs[pair]);
delink_color_pair(sp, pair);
if (last->mode > cpFREE &&
(last->fg != next->fg || last->bg != next->bg)) {
}
if (!found && (SP_PARM->_pair_alloc < SP_PARM->_pair_limit)) {
pair = SP_PARM->_pair_alloc;
- if (_nc_reserve_pairs(sp, pair) == 0) {
+ ReservePairs(SP_PARM, pair);
+ if (SP_PARM->_color_pairs == 0) {
pair = -1;
} else {
found = TRUE;