Module Name: src Committed By: christos Date: Sun Feb 19 19:38:14 UTC 2012
Modified Files: src/lib/libcurses: clrtobot.c clrtoeol.c Log Message: PR/46049: Tim van der Molen: clrtobot() and clrtoeol() do not set background attributes To generate a diff of this commit: cvs rdiff -u -r1.21 -r1.22 src/lib/libcurses/clrtobot.c cvs rdiff -u -r1.25 -r1.26 src/lib/libcurses/clrtoeol.c Please note that diffs are not public domain; they are subject to the copyright notices on the relevant files.
Modified files: Index: src/lib/libcurses/clrtobot.c diff -u src/lib/libcurses/clrtobot.c:1.21 src/lib/libcurses/clrtobot.c:1.22 --- src/lib/libcurses/clrtobot.c:1.21 Wed Jul 22 12:57:14 2009 +++ src/lib/libcurses/clrtobot.c Sun Feb 19 14:38:13 2012 @@ -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 @@ wclrtobot(WINDOW *win) 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 @@ wclrtobot(WINDOW *win) 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) Index: src/lib/libcurses/clrtoeol.c diff -u src/lib/libcurses/clrtoeol.c:1.25 src/lib/libcurses/clrtoeol.c:1.26 --- src/lib/libcurses/clrtoeol.c:1.25 Wed Jul 22 12:57:14 2009 +++ src/lib/libcurses/clrtoeol.c Sun Feb 19 14:38:13 2012 @@ -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 @@ wclrtoeol(WINDOW *win) 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 @@ wclrtoeol(WINDOW *win) 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)