aboutsummaryrefslogtreecommitdiff
path: root/ncurses/widechar
diff options
context:
space:
mode:
Diffstat (limited to 'ncurses/widechar')
-rw-r--r--ncurses/widechar/lib_cchar.c16
-rw-r--r--ncurses/widechar/lib_ins_wch.c6
-rw-r--r--ncurses/widechar/lib_vid_attr.c23
-rw-r--r--ncurses/widechar/widechars.c6
4 files changed, 29 insertions, 22 deletions
diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c
index ed1d236d900c..62a1113ecaa6 100644
--- a/ncurses/widechar/lib_cchar.c
+++ b/ncurses/widechar/lib_cchar.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright 2019,2020 Thomas E. Dickey *
+ * Copyright 2019-2020,2021 Thomas E. Dickey *
* Copyright 2001-2016,2017 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
@@ -35,8 +35,9 @@
*/
#include <curses.priv.h>
+#include <wchar.h>
-MODULE_ID("$Id: lib_cchar.c,v 1.33 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_cchar.c,v 1.35 2021/01/17 00:04:08 tom Exp $")
/*
* The SuSv2 description leaves some room for interpretation. We'll assume wch
@@ -55,7 +56,7 @@ setcchar(cchar_t *wcval,
int color_pair = pair_arg;
unsigned len;
- TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,%lu,%d,%p)"),
+ TR(TRACE_CCALLS, (T_CALLED("setcchar(%p,%s,attrs=%lu,pair=%d,%p)"),
(void *) wcval, _nc_viswbuf(wch),
(unsigned long) attrs, color_pair, opts));
@@ -113,7 +114,12 @@ getcchar(const cchar_t *wcval,
(void *) pair_arg,
opts));
- if (opts == NULL && wcval != NULL) {
+#if !NCURSES_EXT_COLORS
+ if (opts != NULL) {
+ ; /* empty */
+ } else
+#endif
+ if (wcval != NULL) {
wchar_t *wp;
int len;
@@ -130,6 +136,8 @@ getcchar(const cchar_t *wcval,
} else if (attrs == 0 || pair_arg == 0) {
code = ERR;
} else if (len >= 0) {
+ TR(TRACE_CCALLS, ("copy %d wchars, first is %s", len,
+ _tracecchar_t(wcval)));
*attrs = AttrOf(*wcval) & A_ATTRIBUTES;
color_pair = GetPair(*wcval);
get_extended_pair(opts, color_pair);
diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c
index a744f5bf138c..f75361081b62 100644
--- a/ncurses/widechar/lib_ins_wch.c
+++ b/ncurses/widechar/lib_ins_wch.c
@@ -40,7 +40,7 @@
#include <curses.priv.h>
-MODULE_ID("$Id: lib_ins_wch.c,v 1.24 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_ins_wch.c,v 1.25 2020/12/05 20:04:59 tom Exp $")
/*
* Insert the given character, updating the current location to simplify
@@ -111,7 +111,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
if (win != 0
&& wstr != 0) {
if (n < 1)
- n = (int) wcslen(wstr);
+ n = INT_MAX;
code = OK;
if (n > 0) {
@@ -120,7 +120,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n)
NCURSES_SIZE_T oy = win->_cury;
NCURSES_SIZE_T ox = win->_curx;
- for (cp = wstr; ((cp - wstr) < n) && *cp; cp++) {
+ for (cp = wstr; (*cp != L'\0') && ((cp - wstr) < n); cp++) {
int len = _nc_wacs_width(*cp);
if ((len >= 0 && len != 1) || !is7bits(*cp)) {
diff --git a/ncurses/widechar/lib_vid_attr.c b/ncurses/widechar/lib_vid_attr.c
index e167bebeec64..2d9531f1b864 100644
--- a/ncurses/widechar/lib_vid_attr.c
+++ b/ncurses/widechar/lib_vid_attr.c
@@ -37,7 +37,7 @@
#define CUR SP_TERMTYPE
#endif
-MODULE_ID("$Id: lib_vid_attr.c,v 1.28 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: lib_vid_attr.c,v 1.30 2020/05/27 23:54:31 tom Exp $")
#define doPut(mode) \
TPUTS_TRACE(#mode); \
@@ -191,16 +191,16 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
if (turn_on || turn_off) {
TPUTS_TRACE("set_attributes");
NCURSES_SP_NAME(tputs) (NCURSES_SP_ARGx
- TPARM_9(set_attributes,
- (newmode & A_STANDOUT) != 0,
- (newmode & A_UNDERLINE) != 0,
- (newmode & A_REVERSE) != 0,
- (newmode & A_BLINK) != 0,
- (newmode & A_DIM) != 0,
- (newmode & A_BOLD) != 0,
- (newmode & A_INVIS) != 0,
- (newmode & A_PROTECT) != 0,
- (newmode & A_ALTCHARSET) != 0),
+ TIPARM_9(set_attributes,
+ (newmode & A_STANDOUT) != 0,
+ (newmode & A_UNDERLINE) != 0,
+ (newmode & A_REVERSE) != 0,
+ (newmode & A_BLINK) != 0,
+ (newmode & A_DIM) != 0,
+ (newmode & A_BOLD) != 0,
+ (newmode & A_INVIS) != 0,
+ (newmode & A_PROTECT) != 0,
+ (newmode & A_ALTCHARSET) != 0),
1, outc);
previous_attr &= ALL_BUT_COLOR;
previous_pair = 0;
@@ -264,7 +264,6 @@ NCURSES_SP_NAME(vid_puts) (NCURSES_SP_DCLx
TurnOn(A_VERTICAL, enter_vertical_hl_mode);
#endif
/* *INDENT-ON* */
-
}
if (reverse)
diff --git a/ncurses/widechar/widechars.c b/ncurses/widechar/widechars.c
index 35774793216d..d05ba98a8265 100644
--- a/ncurses/widechar/widechars.c
+++ b/ncurses/widechar/widechars.c
@@ -31,9 +31,9 @@
#if USE_WIDEC_SUPPORT
-MODULE_ID("$Id: widechars.c,v 1.7 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: widechars.c,v 1.9 2020/08/29 16:22:03 juergen Exp $")
-#if defined(_WIN32)
+#if (defined(_NC_WINDOWS)) && !defined(_NC_MSC)
/*
* MinGW has wide-character functions, but they do not work correctly.
*/
@@ -148,6 +148,6 @@ _nc_wctomb(char *s, wchar_t wc)
return result;
}
-#endif /* _WIN32 */
+#endif /* _NC_WINDOWS */
#endif /* USE_WIDEC_SUPPORT */