Module Name:    src
Committed By:   bouyer
Date:           Sat Mar 17 17:51:48 UTC 2012

Modified Files:
        src/lib/libcurses [netbsd-6]: clrtobot.c clrtoeol.c

Log Message:
Pull up following revision(s) (requested by blymn in ticket #121):
        lib/libcurses/clrtoeol.c: revision 1.26
        lib/libcurses/clrtobot.c: revision 1.22
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.21.8.1 src/lib/libcurses/clrtobot.c
cvs rdiff -u -r1.25 -r1.25.8.1 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.21.8.1
--- src/lib/libcurses/clrtobot.c:1.21	Wed Jul 22 16:57:14 2009
+++ src/lib/libcurses/clrtobot.c	Sat Mar 17 17:51:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: clrtobot.c,v 1.21 2009/07/22 16:57:14 roy Exp $	*/
+/*	$NetBSD: clrtobot.c,v 1.21.8.1 2012/03/17 17:51:47 bouyer 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.21.8.1 2012/03/17 17:51:47 bouyer 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.25.8.1
--- src/lib/libcurses/clrtoeol.c:1.25	Wed Jul 22 16:57:14 2009
+++ src/lib/libcurses/clrtoeol.c	Sat Mar 17 17:51:47 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: clrtoeol.c,v 1.25 2009/07/22 16:57:14 roy Exp $	*/
+/*	$NetBSD: clrtoeol.c,v 1.25.8.1 2012/03/17 17:51:47 bouyer 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.25.8.1 2012/03/17 17:51:47 bouyer 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)

Reply via email to