From 479c200deaeba6b342fcb51ecb9e988024e014a9 Mon Sep 17 00:00:00 2001 From: "Jordan K. Hubbard" Date: Fri, 6 Sep 1996 05:55:48 +0000 Subject: [PATCH] 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 --- lib/libncurses/lib_kernel.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/libncurses/lib_kernel.c b/lib/libncurses/lib_kernel.c index bd81fe134da..a96cbfccdc8 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;