aboutsummaryrefslogtreecommitdiff
path: root/ncurses/base/lib_addch.c
diff options
context:
space:
mode:
authorRong-En Fan <rafan@FreeBSD.org>2008-11-09 14:08:54 +0000
committerRong-En Fan <rafan@FreeBSD.org>2008-11-09 14:08:54 +0000
commit6181f4622a00a9de81df01cecb5fa73ffdb697bc (patch)
treec963ba08ac935d7f048b78517309fe6fc2f496e6 /ncurses/base/lib_addch.c
parentc0e48ca1322e978a8f9795a5ddb251df2479f930 (diff)
downloadsrc-6181f4622a00a9de81df01cecb5fa73ffdb697bc.tar.gz
src-6181f4622a00a9de81df01cecb5fa73ffdb697bc.zip
- Import ncurses 5.7-20081102 (5.7 release) onto vendor branchvendor/ncurses/5.7-20081102
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=184798 svn path=/vendor/ncurses/5.7-20081102/; revision=184799; tag=vendor/ncurses/5.7-20081102
Diffstat (limited to 'ncurses/base/lib_addch.c')
-rw-r--r--ncurses/base/lib_addch.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c
index 17ba6e2bcd6c..20a97a01a011 100644
--- a/ncurses/base/lib_addch.c
+++ b/ncurses/base/lib_addch.c
@@ -36,7 +36,7 @@
#include <curses.priv.h>
#include <ctype.h>
-MODULE_ID("$Id: lib_addch.c,v 1.111 2008/03/29 18:48:02 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.113 2008/08/16 19:20:04 tom Exp $")
static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
@@ -210,7 +210,7 @@ _nc_build_wch(WINDOW *win, ARG_CH_T ch)
WINDOW_EXT(win, addch_y) = y;
init_mb(state);
- buffer[WINDOW_EXT(win, addch_used)] = CharOf(CHDEREF(ch));
+ buffer[WINDOW_EXT(win, addch_used)] = (char) CharOf(CHDEREF(ch));
WINDOW_EXT(win, addch_used) += 1;
buffer[WINDOW_EXT(win, addch_used)] = '\0';
if ((len = mbrtowc(&result,
@@ -290,12 +290,15 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
int len = wcwidth(CharOf(ch));
int i;
int j;
+ wchar_t *chars;
if (len == 0) { /* non-spacing */
if ((x > 0 && y >= 0)
- || ((y = win->_cury - 1) >= 0 &&
- (x = win->_maxx) > 0)) {
- wchar_t *chars = (win->_line[y].text[x - 1].chars);
+ || (win->_maxx >= 0 && win->_cury >= 1)) {
+ if (x > 0 && y >= 0)
+ chars = (win->_line[y].text[x - 1].chars);
+ else
+ chars = (win->_line[y - 1].text[win->_maxx].chars);
for (i = 0; i < CCHARW_MAX; ++i) {
if (chars[i] == 0) {
TR(TRACE_VIRTPUT,