Source-Changes-HG archive

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

[src/trunk]: src/lib/libcurses PR/46049: Tim van der Molen:



details:   https://anonhg.NetBSD.org/src/rev/206bdbf10744
branches:  trunk
changeset: 777468:206bdbf10744
user:      christos <christos%NetBSD.org@localhost>
date:      Sun Feb 19 19:38:13 2012 +0000

description:
PR/46049: Tim van der Molen:
clrtobot() and clrtoeol() do not set background attributes

diffstat:

 lib/libcurses/clrtobot.c |  15 +++++++++------
 lib/libcurses/clrtoeol.c |  10 +++++-----
 2 files changed, 14 insertions(+), 11 deletions(-)

diffs (85 lines):

diff -r 1579b136d5cf -r 206bdbf10744 lib/libcurses/clrtobot.c
--- a/lib/libcurses/clrtobot.c  Sun Feb 19 19:18:40 2012 +0000
+++ b/lib/libcurses/clrtobot.c  Sun Feb 19 19:38:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clrtobot.c,v 1.21 2009/07/22 16:57:14 roy Exp $        */
+/*     $NetBSD: clrtobot.c,v 1.22 2012/02/19 19:38:13 christos Exp $   */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)clrtobot.c 8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: clrtobot.c,v 1.21 2009/07/22 16:57:14 roy Exp $");
+__RCSID("$NetBSD: clrtobot.c,v 1.22 2012/02/19 19:38:13 christos Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -77,8 +77,8 @@
                starty = win->cury;
                startx = win->curx;
        }
-       if (__using_color && win != curscr)
-               attr = win->battr & __COLOR;
+       if (win != curscr)
+               attr = win->battr & __ATTRIBUTES;
        else
                attr = 0;
        for (y = starty; y < win->maxy; y++) {
@@ -89,12 +89,15 @@
                        if (sp->ch != win->bch || sp->attr != attr) {
 #else
                        if (sp->ch != (wchar_t)btowc((int) win->bch) ||
-                           (sp->attr & WA_ATTRIBUTES) != 0 || sp->nsp) {
+                           (sp->attr & WA_ATTRIBUTES) != attr || sp->nsp) {
 #endif /* HAVE_WCHAR */
                                maxx = sp;
                                if (minx == -1)
                                        minx = (int)(sp - win->alines[y]->line);
-                               sp->attr = attr;
+                               if (sp->attr & __ALTCHARSET)
+                                       sp->attr = attr | __ALTCHARSET;
+                               else
+                                       sp->attr = attr;
 #ifdef HAVE_WCHAR
                                sp->ch = ( wchar_t )btowc(( int ) win->bch);
                                if (_cursesi_copy_nsp(win->bnsp, sp) == ERR)
diff -r 1579b136d5cf -r 206bdbf10744 lib/libcurses/clrtoeol.c
--- a/lib/libcurses/clrtoeol.c  Sun Feb 19 19:18:40 2012 +0000
+++ b/lib/libcurses/clrtoeol.c  Sun Feb 19 19:38:13 2012 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: clrtoeol.c,v 1.25 2009/07/22 16:57:14 roy Exp $        */
+/*     $NetBSD: clrtoeol.c,v 1.26 2012/02/19 19:38:13 christos Exp $   */
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)clrtoeol.c 8.2 (Berkeley) 5/4/94";
 #else
-__RCSID("$NetBSD: clrtoeol.c,v 1.25 2009/07/22 16:57:14 roy Exp $");
+__RCSID("$NetBSD: clrtoeol.c,v 1.26 2012/02/19 19:38:13 christos Exp $");
 #endif
 #endif                         /* not lint */
 
@@ -82,8 +82,8 @@
        end = &win->alines[y]->line[win->maxx];
        minx = -1;
        maxx = &win->alines[y]->line[x];
-       if (__using_color && win != curscr)
-               attr = win->battr & __COLOR;
+       if (win != curscr)
+               attr = win->battr & __ATTRIBUTES;
        else
                attr = 0;
        for (sp = maxx; sp < end; sp++)
@@ -97,7 +97,7 @@
                        maxx = sp;
                        if (minx == -1)
                                minx = (int) (sp - win->alines[y]->line);
-                       sp->attr = attr;
+                       sp->attr = attr | (sp->attr & __ALTCHARSET);
 #ifdef HAVE_WCHAR
                        sp->ch = ( wchar_t )btowc(( int ) win->bch);
                        if (_cursesi_copy_nsp(win->bnsp, sp) == ERR)



Home | Main Index | Thread Index | Old Index