From owner-svn-src-all@FreeBSD.ORG Tue Apr 8 14:14:26 2014 Return-Path: Delivered-To: svn-src-all@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 493B2551; Tue, 8 Apr 2014 14:14:26 +0000 (UTC) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:1900:2254:2068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 35A661648; Tue, 8 Apr 2014 14:14:26 +0000 (UTC) Received: from svn.freebsd.org ([127.0.1.70]) by svn.freebsd.org (8.14.8/8.14.8) with ESMTP id s38EEQ4e045454; Tue, 8 Apr 2014 14:14:26 GMT (envelope-from ray@svn.freebsd.org) Received: (from ray@localhost) by svn.freebsd.org (8.14.8/8.14.8/Submit) id s38EEQJC045453; Tue, 8 Apr 2014 14:14:26 GMT (envelope-from ray@svn.freebsd.org) Message-Id: <201404081414.s38EEQJC045453@svn.freebsd.org> From: Aleksandr Rybalko Date: Tue, 8 Apr 2014 14:14:26 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r264258 - head/sys/dev/vt X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-all@freebsd.org X-Mailman-Version: 2.1.17 Precedence: list List-Id: "SVN commit messages for the entire src tree \(except for " user" and " projects" \)" List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 08 Apr 2014 14:14:26 -0000 Author: ray Date: Tue Apr 8 14:14:25 2014 New Revision: 264258 URL: http://svnweb.freebsd.org/changeset/base/264258 Log: Fix cursor color in reverse video mode. PR: kern/188196 Submitted by: Claude Buisson (original version) MFC after: 1 week Sponsored by: The FreeBSD Foundation Modified: head/sys/dev/vt/vt_core.c Modified: head/sys/dev/vt/vt_core.c ============================================================================== --- head/sys/dev/vt/vt_core.c Tue Apr 8 07:32:32 2014 (r264257) +++ head/sys/dev/vt/vt_core.c Tue Apr 8 14:14:25 2014 (r264258) @@ -652,24 +652,26 @@ static inline void vt_determine_colors(term_char_t c, int cursor, term_color_t *fg, term_color_t *bg) { + term_color_t tmp; + int invert; + + invert = 0; *fg = TCHAR_FGCOLOR(c); if (TCHAR_FORMAT(c) & TF_BOLD) *fg = TCOLOR_LIGHT(*fg); *bg = TCHAR_BGCOLOR(c); - if (TCHAR_FORMAT(c) & TF_REVERSE) { - term_color_t tmp; + if (TCHAR_FORMAT(c) & TF_REVERSE) + invert ^= 1; + if (cursor) + invert ^= 1; + if (invert) { tmp = *fg; *fg = *bg; *bg = tmp; } - - if (cursor) { - *fg = *bg; - *bg = TC_WHITE; - } } static void