diff options
author | ache <ache@FreeBSD.org> | 1994-12-03 04:27:08 +0000 |
---|---|---|
committer | ache <ache@FreeBSD.org> | 1994-12-03 04:27:08 +0000 |
commit | 394e4390df94bfcfba050a6b410d0fa3b82beab2 (patch) | |
tree | 298535e8d75786ab372dc3495ba9a68a692aa963 /lib | |
parent | 4b914f4b4c9fa76cf117f9a408342f9b76312286 (diff) | |
download | FreeBSD-src-394e4390df94bfcfba050a6b410d0fa3b82beab2.zip FreeBSD-src-394e4390df94bfcfba050a6b410d0fa3b82beab2.tar.gz |
exit_standout don't turn most attributes off, fixed
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libncurses/lib_vidattr.c | 37 |
1 files changed, 15 insertions, 22 deletions
diff --git a/lib/libncurses/lib_vidattr.c b/lib/libncurses/lib_vidattr.c index 94cf31e..9151e30 100644 --- a/lib/libncurses/lib_vidattr.c +++ b/lib/libncurses/lib_vidattr.c @@ -104,32 +104,25 @@ chtype turn_on = (newmode & ~previous_attr) & ~A_COLOR; T(("turning %x off", _traceattr(turn_off))); - if ((turn_off & A_ALTCHARSET) && exit_alt_charset_mode) + if ((turn_off & A_ALTCHARSET) && exit_alt_charset_mode) { tputs(exit_alt_charset_mode, 1, outc); + turn_off &= ~A_ALTCHARSET; + } - if ((turn_off & A_BOLD) && exit_standout_mode) - tputs(exit_standout_mode, 1, outc); - - if ((turn_off & A_DIM) && exit_standout_mode) - tputs(exit_standout_mode, 1, outc); - - if ((turn_off & A_BLINK) && exit_standout_mode) - tputs(exit_standout_mode, 1, outc); - - if ((turn_off & A_INVIS) && exit_standout_mode) - tputs(exit_standout_mode, 1, outc); - - if ((turn_off & A_PROTECT) && exit_standout_mode) - tputs(exit_standout_mode, 1, outc); - - if ((turn_off & A_UNDERLINE) && exit_underline_mode) - tputs(exit_underline_mode, 1, outc); + if ((turn_off & A_UNDERLINE) && exit_underline_mode) { + tputs(exit_underline_mode, 1, outc); + turn_off &= ~A_UNDERLINE; + } - if ((turn_off & A_REVERSE) && exit_standout_mode) - tputs(exit_standout_mode, 1, outc); + if ((turn_off & A_STANDOUT) && exit_standout_mode) { + tputs(exit_standout_mode, 1, outc); + turn_off &= ~A_STANDOUT; + } - if ((turn_off & A_STANDOUT) && exit_standout_mode) - tputs(exit_standout_mode, 1, outc); + if (turn_off && exit_attribute_mode) { + tputs(exit_attribute_mode, 1, outc); + turn_on |= newmode & (A_UNDERLINE|A_REVERSE|A_BLINK|A_DIM|A_BOLD|A_INVIS|A_PROTECT); + } T(("turning %x on", _traceattr(turn_on))); |