Changeset 9efa5bd for fmtext.c


Ignore:
Timestamp:
May 1, 2011, 5:29:25 PM (10 years ago)
Author:
David Benjamin <davidben@mit.edu>
Branches:
master, release-1.8, release-1.9
Children:
7b4f3be
Parents:
4fd211f
git-author:
David Benjamin <davidben@mit.edu> (04/26/11 21:07:08)
git-committer:
David Benjamin <davidben@mit.edu> (05/01/11 17:29:25)
Message:
Clamp the number of color pairs to 256 without ext-color

Debian doesn't build their ncurses with ext-color support, so it only
supports 256 colorpairs. However, ncurses still reports the full 32768
value, and color pairs end up trampling over each other.

When 256 is exceeded, the existing colorpair reset logic will now kick
in and fix things. Reword a comment accordingly.

While I'm here, get rid of the colorpairs member in owl_global. ncurses'
works just fine.

Reported-by: Mats Ahlgren <mats_a@mit.edu>
File:
1 edited

Legend:

Unmodified
Added
Removed
  • fmtext.c

    r4479497 r9efa5bd  
    852852  if (!(pair != -1 && pair < cpmgr->next)) {
    853853    /* If we didn't find a pair, search for a free one to assign. */
    854     pair = (cpmgr->next < COLOR_PAIRS) ? cpmgr->next : -1;
     854    pair = (cpmgr->next < owl_util_get_colorpairs()) ? cpmgr->next : -1;
    855855    if (pair != -1) {
    856856      /* We found a free pair, initialize it. */
Note: See TracChangeset for help on using the changeset viewer.