From 575228db065f98f625c642e536a5edf5e66f9602 Mon Sep 17 00:00:00 2001 From: "nethack.allison" Date: Sun, 24 Feb 2002 15:45:05 +0000 Subject: [PATCH] reported a poor display result on the win32 tty when hilite_pet was enabled. After checking into it, the test was looking for the value: (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED) which signifies a white color on win32 console I/O. The problem was that in some cases that was OR'd with something else such as FOREGROUND_INTENSITY. Fix it by checking only the bits that matter when turning on the attribute. --- sys/winnt/nttty.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/winnt/nttty.c b/sys/winnt/nttty.c index 0b2f21e32..f09bfdf70 100644 --- a/sys/winnt/nttty.c +++ b/sys/winnt/nttty.c @@ -791,7 +791,7 @@ term_start_attr(int attr) break; case ATR_INVERSE: /* Suggestion by Lee Berger */ - if (currentcolor == (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)) + if (currentcolor & (FOREGROUND_GREEN|FOREGROUND_BLUE|FOREGROUND_RED)) currentcolor = 0; currentbackground = (BACKGROUND_RED|BACKGROUND_BLUE|BACKGROUND_GREEN); colorchange = TRUE;