summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--sys/dev/ic/vga.c6
-rw-r--r--sys/dev/isa/ega.c6
2 files changed, 6 insertions, 6 deletions
diff --git a/sys/dev/ic/vga.c b/sys/dev/ic/vga.c
index a1560921ecc..a80b3392163 100644
--- a/sys/dev/ic/vga.c
+++ b/sys/dev/ic/vga.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: vga.c,v 1.42 2006/11/29 19:11:15 miod Exp $ */
+/* $OpenBSD: vga.c,v 1.43 2006/12/02 19:11:09 miod Exp $ */
/* $NetBSD: vga.c,v 1.28.2.1 2000/06/30 16:27:47 simonb Exp $ */
/*
@@ -984,10 +984,10 @@ vga_alloc_attr(id, fg, bg, flags, attrp)
if (flags & (WSATTR_UNDERLINE | WSATTR_REVERSE))
return (EINVAL);
if (flags & WSATTR_WSCOLORS)
- *attrp = fgansitopc[fg] | bgansitopc[bg];
+ *attrp = fgansitopc[fg & 7] | bgansitopc[bg & 7];
else
*attrp = 7;
- if (flags & WSATTR_HILIT)
+ if ((flags & WSATTR_HILIT) || (fg & 8) || (bg & 8))
*attrp += 8;
}
if (flags & WSATTR_BLINK)
diff --git a/sys/dev/isa/ega.c b/sys/dev/isa/ega.c
index 3777e5a3f51..a63a028455a 100644
--- a/sys/dev/isa/ega.c
+++ b/sys/dev/isa/ega.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ega.c,v 1.10 2006/11/29 19:08:22 miod Exp $ */
+/* $OpenBSD: ega.c,v 1.11 2006/12/02 19:11:11 miod Exp $ */
/* $NetBSD: ega.c,v 1.4.4.1 2000/06/30 16:27:47 simonb Exp $ */
/*
@@ -888,10 +888,10 @@ ega_alloc_attr(id, fg, bg, flags, attrp)
if (flags & (WSATTR_UNDERLINE | WSATTR_REVERSE))
return (EINVAL);
if (flags & WSATTR_WSCOLORS)
- *attrp = fgansitopc[fg] | bgansitopc[bg];
+ *attrp = fgansitopc[fg & 7] | bgansitopc[bg & 7];
else
*attrp = 7;
- if (flags & WSATTR_HILIT)
+ if ((flags & WSATTR_HILIT) || (fg & 8) || (bg & 8))
*attrp += 8;
}
if (flags & WSATTR_BLINK)