summaryrefslogtreecommitdiffstats
path: root/lib/libncurses/lib_kernel.c
diff options
context:
space:
mode:
authorjkh <jkh@FreeBSD.org>1996-09-06 05:55:48 +0000
committerjkh <jkh@FreeBSD.org>1996-09-06 05:55:48 +0000
commitb83f9c3559c37283a817dd18c9a4713b4e3ce785 (patch)
treee18a56af0fbd60fe2e054a8f1a9d36406800b143 /lib/libncurses/lib_kernel.c
parent458938509f81d8f57dba30656c647d150d1589a5 (diff)
downloadFreeBSD-src-b83f9c3559c37283a817dd18c9a4713b4e3ce785.zip
FreeBSD-src-b83f9c3559c37283a817dd18c9a4713b4e3ce785.tar.gz
Don't smash attributes when turning color values off. This was submitted
as a PR to GNATs but it evidently went astray somehow since I can't find it in the database now, nor does an assigned PR# appear on the mail I got. Sorry about that, Danny! Submitted-By: Danny R. Johnston <danny@simn.com>
Diffstat (limited to 'lib/libncurses/lib_kernel.c')
-rw-r--r--lib/libncurses/lib_kernel.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/libncurses/lib_kernel.c b/lib/libncurses/lib_kernel.c
index bd81fe1..a96cbfc 100644
--- a/lib/libncurses/lib_kernel.c
+++ b/lib/libncurses/lib_kernel.c
@@ -44,12 +44,12 @@ int wattroff(WINDOW *win, chtype at)
if (PAIR_NUMBER(at) == 0xff) /* turn off color */
win->_attrs &= ~at;
else /* leave color alone */
- win->_attrs &= ~(at|~A_COLOR);
+ win->_attrs &= ~(at & ~A_COLOR);
} else {
if (PAIR_NUMBER(at) > 0x00) /* turn off color */
win->_attrs &= ~at;
else /* leave color alone */
- win->_attrs &= ~(at|~A_COLOR);
+ win->_attrs &= ~(at & ~A_COLOR);
}
T(("new attribute is %s", _traceattr(win->_attrs)));
return OK;
OpenPOWER on IntegriCloud