diff options
author | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-05-31 23:31:43 +0000 |
---|---|---|
committer | Aaron Campbell <aaron@cvs.openbsd.org> | 2000-05-31 23:31:43 +0000 |
commit | df3c2eb5f8152c0f8362460fe64ff1afecc4dec3 (patch) | |
tree | 65b797b13b5f696ee336d5ac62580a3c81862297 /sys/arch/i386/isa/pcvt | |
parent | ff09d322bde3a4ebfddce7bd353da631375267eb (diff) |
Sigh... Fix a stupid bug wrt reverse video attributes (when using the newer
"PC Display" functionality -- the default now). Previously the code did
not check the current status of the VT_INVERSE bit when processing a
reverse "off" or "on" request. As a result, two of either operations in a
row would flip the bits, then flip them back again. Thanks to millert@ who
found the problem when playing with the trn news software.
Diffstat (limited to 'sys/arch/i386/isa/pcvt')
-rw-r--r-- | sys/arch/i386/isa/pcvt/pcvt_vtf.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/sys/arch/i386/isa/pcvt/pcvt_vtf.c b/sys/arch/i386/isa/pcvt/pcvt_vtf.c index 86b5a666f41..a2978f91ee5 100644 --- a/sys/arch/i386/isa/pcvt/pcvt_vtf.c +++ b/sys/arch/i386/isa/pcvt/pcvt_vtf.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pcvt_vtf.c,v 1.15 2000/04/12 13:20:41 aaron Exp $ */ +/* $OpenBSD: pcvt_vtf.c,v 1.16 2000/05/31 23:31:42 aaron Exp $ */ /* * Copyright (c) 1992, 1995 Hellmuth Michaelis and Joerg Wunsch. @@ -182,8 +182,7 @@ vt_sgr(struct video_state *svsp) break; case 7: /* reverse */ - svsp->vtsgr |= VT_INVERSE; - if (pcdisp) { + if (pcdisp && !(svsp->vtsgr & VT_INVERSE)) { if ((setcolor >> 8) == 0) setcolor = (FG_LIGHTGREY << 8); setcolor = (((setcolor >> 8) & 0x88) | @@ -191,6 +190,7 @@ vt_sgr(struct video_state *svsp) ((setcolor >> 8) << 4)) & 0x77)) << 8; colortouched = 1; } + svsp->vtsgr |= VT_INVERSE; break; case 22: /* not bold */ @@ -218,13 +218,13 @@ vt_sgr(struct video_state *svsp) break; case 27: /* not reverse */ - svsp->vtsgr &= ~VT_INVERSE; - if (pcdisp) { + if (pcdisp && (svsp->vtsgr & VT_INVERSE)) { setcolor = (((setcolor >> 8) & 0x88) | ((((setcolor >> 8) >> 4) | ((setcolor >> 8) << 4)) & 0x77)) << 8; colortouched = 1; } + svsp->vtsgr &= ~VT_INVERSE; break; case 30: /* foreground colors */ |