Re: change log fix: [Patch] bug # 514 (cygwin console handling)
On Dec 1 08:16, Thomas Wolff wrote: Sorry, I missed to insert the function name in the change log entry, so here it is again as an update; the patch is the same. This is a small patch that fixes http://sourceware.org/bugzilla/show_bug.cgi?id=514 Please integrate it into the cygwin DLL. I guess the patch is pretty much ok and I'm inclined to let it pass under the trivial patch rule... iff you change it so that the #ifdef goes away. Which alternative seems more appropriate resp. which one results in the more readable output? It's the one we should choose (since any choice will result in complains anyway). 2004-11-26 Thomas Wolff [EMAIL PROTECTED] * fhandler_console.cc (get_win32_attr): Avoid inappropriate intensity interchanging that used to render reverse output unreadable when (non-reversed) text is bright. See http://sourceware.org/bugzilla/show_bug.cgi?id=514 There are two useful alternatives to handle this; both are in the patch (#ifdef reverse_bright) and one is selected by #define: a) (selected) bright foreground will reverse to a bright background, b) bright foreground will reverse to a dim background but the background will no longer reverse to a bright foreground (which used to render reverse output unreadable). And please shorten the ChangeLog entry to about one sentence. Thanks, Corinna -- Corinna Vinschen Please, send mails regarding Cygwin to Cygwin Project Co-Leader mailto:[EMAIL PROTECTED] Red Hat, Inc.
change log fix: [Patch] bug # 514 (cygwin console handling)
Sorry, I missed to insert the function name in the change log entry, so here it is again as an update; the patch is the same. This is a small patch that fixes http://sourceware.org/bugzilla/show_bug.cgi?id=514 Please integrate it into the cygwin DLL. 2004-11-26 Thomas Wolff [EMAIL PROTECTED] * fhandler_console.cc (get_win32_attr): Avoid inappropriate intensity interchanging that used to render reverse output unreadable when (non-reversed) text is bright. See http://sourceware.org/bugzilla/show_bug.cgi?id=514 There are two useful alternatives to handle this; both are in the patch (#ifdef reverse_bright) and one is selected by #define: a) (selected) bright foreground will reverse to a bright background, b) bright foreground will reverse to a dim background but the background will no longer reverse to a bright foreground (which used to render reverse output unreadable). --- cygwin-1.5.12-1/winsup/cygwin/fhandler_console.cc 2004-10-28 17:33:04.0 +0200 +++ cygwin-1.5.12-1/winsup/cygwin/fhandler_console.cc.fix5142004-11-30 12:44:03.499523500 +0100 @@ -921,14 +921,32 @@ fhandler_console::get_win32_attr () if (dev_state-reverse) { WORD save_fg = win_fg; +#define reverse_bright +#ifdef reverse_bright + /* This way, a bright foreground will reverse to a bright background. + */ win_fg = (win_bg BACKGROUND_RED ? FOREGROUND_RED : 0) | (win_bg BACKGROUND_GREEN ? FOREGROUND_GREEN : 0) | (win_bg BACKGROUND_BLUE ? FOREGROUND_BLUE : 0) | - (win_fg FOREGROUND_INTENSITY); + (win_bg BACKGROUND_INTENSITY ? FOREGROUND_INTENSITY : 0); win_bg = (save_fg FOREGROUND_RED ? BACKGROUND_RED : 0) | (save_fg FOREGROUND_GREEN ? BACKGROUND_GREEN : 0) | (save_fg FOREGROUND_BLUE ? BACKGROUND_BLUE : 0) | - (win_bg BACKGROUND_INTENSITY); + (save_fg FOREGROUND_INTENSITY ? BACKGROUND_INTENSITY : 0); +#else + /* This way, a bright foreground will reverse to a dim background. + But the background will no longer reverse to a bright foreground + (which used to render reverse output unreadable). + */ + win_fg = (win_bg BACKGROUND_RED ? FOREGROUND_RED : 0) | + (win_bg BACKGROUND_GREEN ? FOREGROUND_GREEN : 0) | + (win_bg BACKGROUND_BLUE ? FOREGROUND_BLUE : 0) | + (win_bg FOREGROUND_INTENSITY); + win_bg = (save_fg FOREGROUND_RED ? BACKGROUND_RED : 0) | + (save_fg FOREGROUND_GREEN ? BACKGROUND_GREEN : 0) | + (save_fg FOREGROUND_BLUE ? BACKGROUND_BLUE : 0) | + (save_fg BACKGROUND_INTENSITY); +#endif } if (dev_state-underline) win_fg = dev_state-underline_color;