- if ((sp->_color_pairs != 0) && (want < sp->_pair_alloc)) {
- result = &(sp->_color_pairs[want]);
- } else {
-
- if (have == 0)
- have = 1;
- while (have <= want)
- have *= 2;
- if (have > sp->_pair_limit)
- have = sp->_pair_limit;
-
- if (sp->_color_pairs == 0) {
- sp->_color_pairs = TYPE_CALLOC(colorpair_t, have);
- } else if (have > sp->_pair_alloc) {
-#if USE_NEW_PAIR
- colorpair_t *next;
-
- if ((next = typeCalloc(colorpair_t, have)) == 0)
- _nc_err_abort(MSG_NO_MEMORY);
- memcpy(next, sp->_color_pairs, (size_t) sp->_pair_alloc * sizeof(*next));
- _nc_copy_pairs(sp, next, sp->_color_pairs, sp->_pair_alloc);
- free(sp->_color_pairs);
- sp->_color_pairs = next;
+ if (have == 0)
+ have = 1;
+ while (have <= want)
+ have *= 2;
+ if (have > sp->_pair_limit)
+ have = sp->_pair_limit;
+
+ if (sp->_color_pairs == 0) {
+ sp->_color_pairs = TYPE_CALLOC(colorpair_t, have);
+ } else if (have > sp->_pair_alloc) {
+#if NCURSES_EXT_COLORS
+ colorpair_t *next;
+
+ if ((next = typeCalloc(colorpair_t, have)) == 0)
+ _nc_err_abort(MSG_NO_MEMORY);
+ memcpy(next, sp->_color_pairs, (size_t) sp->_pair_alloc * sizeof(*next));
+ _nc_copy_pairs(sp, next, sp->_color_pairs, sp->_pair_alloc);
+ free(sp->_color_pairs);
+ sp->_color_pairs = next;