Module Name:    src
Committed By:   blymn
Date:           Sat Apr 21 11:33:16 UTC 2012

Modified Files:
        src/lib/libcurses: inchstr.c refresh.c

Log Message:
Fix build break if curses is built without wide char support


To generate a diff of this commit:
cvs rdiff -u -r1.5 -r1.6 src/lib/libcurses/inchstr.c
cvs rdiff -u -r1.75 -r1.76 src/lib/libcurses/refresh.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/inchstr.c
diff -u src/lib/libcurses/inchstr.c:1.5 src/lib/libcurses/inchstr.c:1.6
--- src/lib/libcurses/inchstr.c:1.5	Sat Apr 21 11:31:59 2012
+++ src/lib/libcurses/inchstr.c	Sat Apr 21 11:33:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: inchstr.c,v 1.5 2012/04/21 11:31:59 blymn Exp $	*/
+/*	$NetBSD: inchstr.c,v 1.6 2012/04/21 11:33:16 blymn Exp $	*/
 
 /*
  * Copyright 2001 Wasabi Systems, Inc.
@@ -37,7 +37,7 @@
 
 #include <sys/cdefs.h>
 #ifndef lint
-__RCSID("$NetBSD: inchstr.c,v 1.5 2012/04/21 11:31:59 blymn Exp $");
+__RCSID("$NetBSD: inchstr.c,v 1.6 2012/04/21 11:33:16 blymn Exp $");
 #endif				/* not lint */
 
 #include "curses.h"
@@ -145,7 +145,11 @@ winchnstr(WINDOW *win, chtype *chstr, in
 
 	while (start <= end) {
 		/* or in the attributes but strip out internal flags */
+#ifdef HAVE_WCHAR
 		*chstr = start->ch | (start->attr & ~__ACS_IS_WACS);
+#else
+		*chstr = start->ch | start->attr;
+#endif
 		chstr++;
 		start++;
 	}

Index: src/lib/libcurses/refresh.c
diff -u src/lib/libcurses/refresh.c:1.75 src/lib/libcurses/refresh.c:1.76
--- src/lib/libcurses/refresh.c:1.75	Mon Oct  3 12:32:15 2011
+++ src/lib/libcurses/refresh.c	Sat Apr 21 11:33:16 2012
@@ -1,4 +1,4 @@
-/*	$NetBSD: refresh.c,v 1.75 2011/10/03 12:32:15 roy Exp $	*/
+/*	$NetBSD: refresh.c,v 1.76 2012/04/21 11:33:16 blymn Exp $	*/
 
 /*
  * Copyright (c) 1981, 1993, 1994
@@ -34,7 +34,7 @@
 #if 0
 static char sccsid[] = "@(#)refresh.c	8.7 (Berkeley) 8/13/94";
 #else
-__RCSID("$NetBSD: refresh.c,v 1.75 2011/10/03 12:32:15 roy Exp $");
+__RCSID("$NetBSD: refresh.c,v 1.76 2012/04/21 11:33:16 blymn Exp $");
 #endif
 #endif				/* not lint */
 
@@ -849,8 +849,19 @@ makech(int wy)
 #ifdef DEBUG
 				__CTRACE(__CTRACE_REFRESH,
 				    "makech: have attr %08x, need attr %08x\n",
-				    curscr->wattr & WA_ATTRIBUTES,
-				    nsp->attr & WA_ATTRIBUTES);
+				    curscr->wattr
+#ifndef HAVE_WCHAR
+				 & __ATTRIBUTES
+#else
+				 & WA_ATTRIBUTES
+#endif
+					 ,  nsp->attr
+#ifndef HAVE_WCHAR
+				 & __ATTRIBUTES
+#else
+				 & WA_ATTRIBUTES
+#endif
+					);
 #endif
 
 			off = (~nsp->attr & curscr->wattr)

Reply via email to