diff options
| author | Andrey A. Chernov <ache@FreeBSD.org> | 1998-05-15 21:35:53 +0000 |
|---|---|---|
| committer | Andrey A. Chernov <ache@FreeBSD.org> | 1998-05-15 21:35:53 +0000 |
| commit | 59fcc4ce0f47aa511c3148317a1d15f5c04125c2 (patch) | |
| tree | ed4c95f46924ee532cb249e786cf9766b13d92c2 | |
| parent | 361854f7732df3713ca02a623b30dcfa75ec4e2b (diff) | |
Notes
| -rw-r--r-- | lib/libncurses/lib_vidattr.c | 16 |
1 files changed, 11 insertions, 5 deletions
diff --git a/lib/libncurses/lib_vidattr.c b/lib/libncurses/lib_vidattr.c index 0bb56757d94b..ef8213906227 100644 --- a/lib/libncurses/lib_vidattr.c +++ b/lib/libncurses/lib_vidattr.c @@ -71,13 +71,14 @@ int fg, bg; } } -#define previous_attr SP->_current_attr - int vidputs(chtype newmode, int (*outc)(int)) { -chtype turn_off = (~newmode & previous_attr) & ~A_COLOR; -chtype turn_on = (newmode & ~previous_attr) & ~A_COLOR; -int pair, current_pair; +static chtype previous_attr=0; +chtype turn_off,turn_on; +int pair, current_pair; + + if (SP) + previous_attr = SP->_current_attr; T(("vidputs(%x) called %s", newmode, _traceattr(newmode))); T(("previous attribute was %s", _traceattr(previous_attr))); @@ -85,6 +86,9 @@ int pair, current_pair; if (newmode == previous_attr) return OK; + turn_off = (~newmode & previous_attr) & ~A_COLOR; + turn_on = (newmode & ~previous_attr) & ~A_COLOR; + pair = PAIR_NUMBER(newmode); current_pair = PAIR_NUMBER(previous_attr); @@ -184,6 +188,8 @@ int pair, current_pair; } previous_attr = newmode; + if (SP) + SP->_current_attr = previous_attr; T(("vidputs finished")); return OK; |
