Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/lib/libcurses Return the same information whether or not we ...



details:   https://anonhg.NetBSD.org/src/rev/e95457bd806e
branches:  trunk
changeset: 747952:e95457bd806e
user:      jdc <jdc%NetBSD.org@localhost>
date:      Tue Oct 06 20:03:27 2009 +0000

description:
Return the same information whether or not we have wide characters.
Problem pointed out by Rhialto on current-users.

diffstat:

 lib/libcurses/inch.c |  21 +++++++++++----------
 1 files changed, 11 insertions(+), 10 deletions(-)

diffs (41 lines):

diff -r 8d621f68350c -r e95457bd806e lib/libcurses/inch.c
--- a/lib/libcurses/inch.c      Tue Oct 06 19:56:58 2009 +0000
+++ b/lib/libcurses/inch.c      Tue Oct 06 20:03:27 2009 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: inch.c,v 1.9 2009/07/22 16:57:14 roy Exp $     */
+/*     $NetBSD: inch.c,v 1.10 2009/10/06 20:03:27 jdc Exp $    */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -31,7 +31,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: inch.c,v 1.9 2009/07/22 16:57:14 roy Exp $");
+__RCSID("$NetBSD: inch.c,v 1.10 2009/10/06 20:03:27 jdc Exp $");
 #endif                         /* not lint */
 
 #include "curses.h"
@@ -81,13 +81,14 @@
 chtype
 winch(WINDOW *win)
 {
-#ifndef HAVE_WCHAR
-       chtype   ch;
+       chtype  ch;
+       attr_t  attr;
 
-       ch = (chtype) (((win)->alines[(win)->cury]->line[(win)->curx].ch & __CHARTEXT) |
-         (chtype) ((win)->alines[(win)->cury]->line[(win)->curx].attr & __ATTRIBUTES));
-       return (ch);
-#else
-       return ( chtype )win->alines[ win->cury ]->line[ win->curx ].ch;
-#endif /* HAVE_WCHAR */
+       ch = (chtype) ((win)->alines[(win)->cury]->line[(win)->curx].ch &
+           __CHARTEXT);
+       attr = (attr_t) ((win)->alines[(win)->cury]->line[(win)->curx].attr &
+           __ATTRIBUTES);
+       if (__using_color && ((attr & __COLOR) == __default_color))
+               attr &= ~__default_color;
+       return (ch | attr);
 }



Home | Main Index | Thread Index | Old Index