From: Thomas E. Dickey Date: Sun, 5 May 2019 00:42:44 +0000 (+0000) Subject: ncurses 6.1 - patch 20190504 X-Git-Tag: v6.2~40 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=88e7914acafc37f84af25b80f403eb4290e423d4 ncurses 6.1 - patch 20190504 + improve workaround for Solaris wcwidth versus line-drawing characters (report by Pavel Stehule). + add special case in tic to validate RGB string-capability extension. + corrected string/parameter-field for RGB in Caps-ncurses. --- diff --git a/NEWS b/NEWS index 5169e74f..b461acde 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3311 2019/04/21 12:57:18 tom Exp $ +-- $Id: NEWS,v 1.3314 2019/05/04 20:55:23 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,12 @@ See the AUTHORS file for the corresponding full names. Changes through 1.9.9e did not credit all contributions; it is not possible to add this information. +20190504 + + improve workaround for Solaris wcwidth versus line-drawing characters + (report by Pavel Stehule). + + add special case in tic to validate RGB string-capability extension. + + corrected string/parameter-field for RGB in Caps-ncurses. + 20190427 + corrected problem in terminfo load/realignment which prevented infocmp from comparing extended capabilities with the same name diff --git a/VERSION b/VERSION index a79ef7e6..b1e46f6a 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20190427 +5:0:10 6.1 20190504 diff --git a/dist.mk b/dist.mk index ab9a61ce..f247558d 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1280 2019/04/21 12:56:30 tom Exp $ +# $Id: dist.mk,v 1.1281 2019/05/04 10:02:52 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -37,7 +37,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 1 -NCURSES_PATCH = 20190427 +NCURSES_PATCH = 20190504 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/include/Caps-ncurses b/include/Caps-ncurses index 3b0ea454..39524de4 100644 --- a/include/Caps-ncurses +++ b/include/Caps-ncurses @@ -28,7 +28,7 @@ # # Author: Thomas E. Dickey # -# $Id: Caps-ncurses,v 1.6 2019/04/13 19:54:23 tom Exp $ +# $Id: Caps-ncurses,v 1.7 2019/05/04 14:10:54 tom Exp $ # ############################################################################# # @@ -345,7 +345,7 @@ used_by ncurses userdef E3 str - clears the terminal's scrollback buffer. userdef RGB bool - use direct colors with 1/3 of color-pair bits per color. userdef RGB num n use direct colors with given number of bits per color. -userdef RGB str nnn use direct colors with given bit-layout. +userdef RGB str - use direct colors with given bit-layout. userdef TS str - like "tsl", but uses no parameter. userdef U8 num n terminal does/does not support VT100 SI/SO when processing UTF-8 encoding. userdef XM str n initialize alternate xterm mouse mode @@ -359,7 +359,7 @@ userdef xm str nnns mouse response, p4 = state, e.g., pressed or released userdef xm str nnnsn mouse response, p5 = y-ordinate starting region userdef xm str nnnsnn mouse response, p6 = x-ordinate starting region userdef xm str nnnsnnn mouse response, p7 = y-ordinate ending region -userdef xm str nnnsnnnn mouse response, p8 = x-ordinate ending region +userdef xm str nnnsnnnn mouse response, p8 = x-ordinate ending region # used_by screen userdef AN bool - turn on autonuke. diff --git a/ncurses/base/lib_addch.c b/ncurses/base/lib_addch.c index ae130ff0..7c70fa63 100644 --- a/ncurses/base/lib_addch.c +++ b/ncurses/base/lib_addch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 1998-2017,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -36,7 +36,7 @@ #include #include -MODULE_ID("$Id: lib_addch.c,v 1.131 2017/07/29 20:42:02 tom Exp $") +MODULE_ID("$Id: lib_addch.c,v 1.132 2019/05/04 20:46:24 tom Exp $") static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT); @@ -303,7 +303,7 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch) * adjustments. */ if_WIDEC({ - int len = wcwidth(CharOf(ch)); + int len = _nc_wacs_width(CharOf(ch)); int i; int j; wchar_t *chars; diff --git a/ncurses/base/lib_addstr.c b/ncurses/base/lib_addstr.c index 9038706f..55dc440b 100644 --- a/ncurses/base/lib_addstr.c +++ b/ncurses/base/lib_addstr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 1998-2017,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #include -MODULE_ID("$Id: lib_addstr.c,v 1.54 2017/03/25 21:10:03 tom Exp $") +MODULE_ID("$Id: lib_addstr.c,v 1.55 2019/05/04 20:46:24 tom Exp $") NCURSES_EXPORT(int) waddnstr(WINDOW *win, const char *astr, int n) @@ -183,7 +183,7 @@ wadd_wchnstr(WINDOW *win, const cchar_t *astr, int n) if (isWidecExt(astr[i])) continue; - len = wcwidth(CharOf(astr[i])); + len = _nc_wacs_width(CharOf(astr[i])); if (x + len - 1 <= win->_maxx) { line->text[x] = _nc_render(win, astr[i]); diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c index dba29809..d2f43022 100644 --- a/ncurses/base/lib_screen.c +++ b/ncurses/base/lib_screen.c @@ -41,7 +41,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_screen.c,v 1.94 2019/03/23 23:47:16 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.95 2019/05/04 20:31:31 tom Exp $") #define MAX_SIZE 0x3fff /* 16k is big enough for a window or pad */ @@ -447,7 +447,7 @@ read_row(char *source, NCURSES_CH_T * prior, NCURSES_CH_T * target, int length) int len; source = decode_cchar(source, prior, target); - len = wcwidth(target->chars[0]); + len = _nc_wacs_width(target->chars[0]); if (len > 1) { int n; @@ -894,7 +894,7 @@ putwin(WINDOW *win, FILE *filep) returnCode(code); for (x = 0; x <= win->_maxx; x++) { #if NCURSES_WIDECHAR - int len = wcwidth(data[x].chars[0]); + int len = _nc_wacs_width(data[x].chars[0]); encode_cell(buffer, TOP_SLIMIT CHREF(data[x]), CHREF(last_cell)); last_cell = data[x]; PUTS(buffer); diff --git a/ncurses/base/lib_slkset.c b/ncurses/base/lib_slkset.c index 9091e001..66a4d043 100644 --- a/ncurses/base/lib_slkset.c +++ b/ncurses/base/lib_slkset.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc. * + * Copyright (c) 1998-2012,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -44,7 +44,7 @@ #endif #endif -MODULE_ID("$Id: lib_slkset.c,v 1.24 2012/12/08 23:09:25 tom Exp $") +MODULE_ID("$Id: lib_slkset.c,v 1.25 2019/05/04 20:46:24 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) @@ -89,9 +89,9 @@ NCURSES_SP_NAME(slk_set) (NCURSES_SP_DCLx int i, const char *astr, int format) mbrtowc(&wc, p, need, &state); if (!iswprint((wint_t) wc)) break; - if (wcwidth(wc) + numcols > limit) + if (_nc_wacs_width(wc) + numcols > limit) break; - numcols += wcwidth(wc); + numcols += _nc_wacs_width(wc); p += need; } numchrs = (int) (p - str); diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index fb5e548b..e7af5822 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -34,7 +34,7 @@ ****************************************************************************/ /* - * $Id: curses.priv.h,v 1.620 2019/03/30 21:31:37 tom Exp $ + * $Id: curses.priv.h,v 1.621 2019/05/04 20:29:09 tom Exp $ * * curses.priv.h * @@ -2038,6 +2038,12 @@ extern NCURSES_EXPORT(void) _nc_expanded (void); ttytype[NAMESIZE - 1] = '\0'; \ } +#if !NCURSES_WCWIDTH_GRAPHICS +extern NCURSES_EXPORT(int) _nc_wacs_width(unsigned); +#else +#define _nc_wacs_width(ch) wcwidth(ch) +#endif + /* charable.c */ #if USE_WIDEC_SUPPORT extern NCURSES_EXPORT(bool) _nc_is_charable(wchar_t); diff --git a/ncurses/tinfo/lib_acs.c b/ncurses/tinfo/lib_acs.c index c552f253..e4fe0bef 100644 --- a/ncurses/tinfo/lib_acs.c +++ b/ncurses/tinfo/lib_acs.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * + * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_acs.c,v 1.47 2018/05/05 17:35:53 tom Exp $") +MODULE_ID("$Id: lib_acs.c,v 1.48 2019/05/04 23:03:08 tom Exp $") #if BROKEN_LINKER || USE_REENTRANT #define MyBuffer _nc_prescreen.real_acs_map @@ -254,3 +254,72 @@ _nc_init_acs(void) NCURSES_SP_NAME(_nc_init_acs) (CURRENT_SCREEN); } #endif + +#if !NCURSES_WCWIDTH_GRAPHICS +NCURSES_EXPORT(int) +_nc_wacs_width(unsigned ch) +{ + int result; + switch (ch) { + case 0x00a3: /* FALLTHRU - ncurses pound-sterling symbol */ + case 0x00b0: /* FALLTHRU - VT100 degree symbol */ + case 0x00b1: /* FALLTHRU - VT100 plus/minus */ + case 0x00b7: /* FALLTHRU - VT100 bullet */ + case 0x03c0: /* FALLTHRU - ncurses greek pi */ + case 0x2190: /* FALLTHRU - Teletype arrow pointing left */ + case 0x2191: /* FALLTHRU - Teletype arrow pointing up */ + case 0x2192: /* FALLTHRU - Teletype arrow pointing right */ + case 0x2193: /* FALLTHRU - Teletype arrow pointing down */ + case 0x2260: /* FALLTHRU - ncurses not-equal */ + case 0x2264: /* FALLTHRU - ncurses less-than-or-equal-to */ + case 0x2265: /* FALLTHRU - ncurses greater-than-or-equal-to */ + case 0x23ba: /* FALLTHRU - VT100 scan line 1 */ + case 0x23bb: /* FALLTHRU - ncurses scan line 3 */ + case 0x23bc: /* FALLTHRU - ncurses scan line 7 */ + case 0x23bd: /* FALLTHRU - VT100 scan line 9 */ + case 0x2500: /* FALLTHRU - VT100 horizontal line */ + case 0x2501: /* FALLTHRU - thick horizontal line */ + case 0x2502: /* FALLTHRU - VT100 vertical line */ + case 0x2503: /* FALLTHRU - thick vertical line */ + case 0x250c: /* FALLTHRU - VT100 upper left corner */ + case 0x250f: /* FALLTHRU - thick upper left corner */ + case 0x2510: /* FALLTHRU - VT100 upper right corner */ + case 0x2513: /* FALLTHRU - thick upper right corner */ + case 0x2514: /* FALLTHRU - VT100 lower left corner */ + case 0x2517: /* FALLTHRU - thick lower left corner */ + case 0x2518: /* FALLTHRU - VT100 lower right corner */ + case 0x251b: /* FALLTHRU - thick lower right corner */ + case 0x251c: /* FALLTHRU - VT100 tee pointing left */ + case 0x2523: /* FALLTHRU - thick tee pointing left */ + case 0x2524: /* FALLTHRU - VT100 tee pointing right */ + case 0x252b: /* FALLTHRU - thick tee pointing right */ + case 0x252c: /* FALLTHRU - VT100 tee pointing down */ + case 0x2533: /* FALLTHRU - thick tee pointing down */ + case 0x2534: /* FALLTHRU - VT100 tee pointing up */ + case 0x253b: /* FALLTHRU - thick tee pointing up */ + case 0x253c: /* FALLTHRU - VT100 large plus or crossover */ + case 0x254b: /* FALLTHRU - thick large plus or crossover */ + case 0x2550: /* FALLTHRU - double horizontal line */ + case 0x2551: /* FALLTHRU - double vertical line */ + case 0x2554: /* FALLTHRU - double upper left corner */ + case 0x2557: /* FALLTHRU - double upper right corner */ + case 0x255a: /* FALLTHRU - double lower left corner */ + case 0x255d: /* FALLTHRU - double lower right corner */ + case 0x2560: /* FALLTHRU - double tee pointing right */ + case 0x2563: /* FALLTHRU - double tee pointing left */ + case 0x2566: /* FALLTHRU - double tee pointing down */ + case 0x2569: /* FALLTHRU - double tee pointing up */ + case 0x256c: /* FALLTHRU - double large plus or crossover */ + case 0x2592: /* FALLTHRU - VT100 checker board (stipple) */ + case 0x25ae: /* FALLTHRU - Teletype solid square block */ + case 0x25c6: /* FALLTHRU - VT100 diamond */ + case 0x2603: /* FALLTHRU - Teletype lantern symbol */ + result = 1; + break; + default: + result = (wcwidth) (ch); + break; + } + return result; +} +#endif /* !NCURSES_WCWIDTH_GRAPHICS */ diff --git a/ncurses/trace/lib_traceatr.c b/ncurses/trace/lib_traceatr.c index a4144ab5..31312c23 100644 --- a/ncurses/trace/lib_traceatr.c +++ b/ncurses/trace/lib_traceatr.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. * + * Copyright (c) 1998-2018,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -43,7 +43,7 @@ #define CUR SP_TERMTYPE #endif -MODULE_ID("$Id: lib_traceatr.c,v 1.92 2018/05/05 17:49:17 tom Exp $") +MODULE_ID("$Id: lib_traceatr.c,v 1.93 2019/05/04 20:46:24 tom Exp $") #define COLOR_OF(c) ((c < 0) ? "default" : (c > 7 ? color_of(c) : colors[c].name)) @@ -365,7 +365,7 @@ _tracecchar_t2(int bufnum, const cchar_t *ch) char temp[80]; _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "{%d:\\u%lx}", - wcwidth(ch->chars[PUTC_i]), + _nc_wacs_width(ch->chars[PUTC_i]), (unsigned long) ch->chars[PUTC_i]); (void) _nc_trace_bufcat(bufnum, temp); break; diff --git a/ncurses/trace/visbuf.c b/ncurses/trace/visbuf.c index 17b590a7..4f78139f 100644 --- a/ncurses/trace/visbuf.c +++ b/ncurses/trace/visbuf.c @@ -42,7 +42,7 @@ #include #include -MODULE_ID("$Id: visbuf.c,v 1.50 2019/02/16 21:18:42 tom Exp $") +MODULE_ID("$Id: visbuf.c,v 1.51 2019/05/04 20:31:31 tom Exp $") #define NUM_VISBUFS 4 @@ -338,7 +338,7 @@ _nc_viscbuf2(int bufnum, const NCURSES_CH_T * buf, int len) if (PUTC_n <= 0 || buf[j].chars[PUTC_i] > 255) { _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp)) "{%d:\\u%lx}", - wcwidth(buf[j].chars[PUTC_i]), + _nc_wacs_width(buf[j].chars[PUTC_i]), (unsigned long) buf[j].chars[PUTC_i]); (void) _nc_trace_bufcat(bufnum, temp); break; diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index b86dfe4e..69de9c2e 100644 --- a/ncurses/tty/tty_update.c +++ b/ncurses/tty/tty_update.c @@ -84,7 +84,7 @@ #include -MODULE_ID("$Id: tty_update.c,v 1.300 2019/02/25 21:42:01 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.302 2019/05/04 22:43:40 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -210,73 +210,8 @@ GoTo(NCURSES_SP_DCLx int const row, int const col) } #if !NCURSES_WCWIDTH_GRAPHICS -static bool -is_wacs_value(unsigned ch) -{ - bool result; - switch (ch) { - case 0x00a3: /* FALLTHRU - ncurses pound-sterling symbol */ - case 0x00b0: /* FALLTHRU - VT100 degree symbol */ - case 0x00b1: /* FALLTHRU - VT100 plus/minus */ - case 0x00b7: /* FALLTHRU - VT100 bullet */ - case 0x03c0: /* FALLTHRU - ncurses greek pi */ - case 0x2190: /* FALLTHRU - Teletype arrow pointing left */ - case 0x2191: /* FALLTHRU - Teletype arrow pointing up */ - case 0x2192: /* FALLTHRU - Teletype arrow pointing right */ - case 0x2193: /* FALLTHRU - Teletype arrow pointing down */ - case 0x2260: /* FALLTHRU - ncurses not-equal */ - case 0x2264: /* FALLTHRU - ncurses less-than-or-equal-to */ - case 0x2265: /* FALLTHRU - ncurses greater-than-or-equal-to */ - case 0x23ba: /* FALLTHRU - VT100 scan line 1 */ - case 0x23bb: /* FALLTHRU - ncurses scan line 3 */ - case 0x23bc: /* FALLTHRU - ncurses scan line 7 */ - case 0x23bd: /* FALLTHRU - VT100 scan line 9 */ - case 0x2500: /* FALLTHRU - VT100 horizontal line */ - case 0x2501: /* FALLTHRU - thick horizontal line */ - case 0x2502: /* FALLTHRU - VT100 vertical line */ - case 0x2503: /* FALLTHRU - thick vertical line */ - case 0x250c: /* FALLTHRU - VT100 upper left corner */ - case 0x250f: /* FALLTHRU - thick upper left corner */ - case 0x2510: /* FALLTHRU - VT100 upper right corner */ - case 0x2513: /* FALLTHRU - thick upper right corner */ - case 0x2514: /* FALLTHRU - VT100 lower left corner */ - case 0x2517: /* FALLTHRU - thick lower left corner */ - case 0x2518: /* FALLTHRU - VT100 lower right corner */ - case 0x251b: /* FALLTHRU - thick lower right corner */ - case 0x251c: /* FALLTHRU - VT100 tee pointing left */ - case 0x2523: /* FALLTHRU - thick tee pointing left */ - case 0x2524: /* FALLTHRU - VT100 tee pointing right */ - case 0x252b: /* FALLTHRU - thick tee pointing right */ - case 0x252c: /* FALLTHRU - VT100 tee pointing down */ - case 0x2533: /* FALLTHRU - thick tee pointing down */ - case 0x2534: /* FALLTHRU - VT100 tee pointing up */ - case 0x253b: /* FALLTHRU - thick tee pointing up */ - case 0x253c: /* FALLTHRU - VT100 large plus or crossover */ - case 0x254b: /* FALLTHRU - thick large plus or crossover */ - case 0x2550: /* FALLTHRU - double horizontal line */ - case 0x2551: /* FALLTHRU - double vertical line */ - case 0x2554: /* FALLTHRU - double upper left corner */ - case 0x2557: /* FALLTHRU - double upper right corner */ - case 0x255a: /* FALLTHRU - double lower left corner */ - case 0x255d: /* FALLTHRU - double lower right corner */ - case 0x2560: /* FALLTHRU - double tee pointing right */ - case 0x2563: /* FALLTHRU - double tee pointing left */ - case 0x2566: /* FALLTHRU - double tee pointing down */ - case 0x2569: /* FALLTHRU - double tee pointing up */ - case 0x256c: /* FALLTHRU - double large plus or crossover */ - case 0x2592: /* FALLTHRU - VT100 checker board (stipple) */ - case 0x25ae: /* FALLTHRU - Teletype solid square block */ - case 0x25c6: /* FALLTHRU - VT100 diamond */ - case 0x2603: /* FALLTHRU - Teletype lantern symbol */ - result = TRUE; - break; - default: - result = FALSE; - break; - } - return result; -} -#endif +#define is_wacs_value(ch) (_nc_wacs_width(ch) == 1 && (wcwidth)(ch) > 1) +#endif /* !NCURSES_WCWIDTH_GRAPHICS */ static NCURSES_INLINE void PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) @@ -304,7 +239,7 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) * Determine the number of character cells which the 'ch' value will use * on the screen. It should be at least one. */ - if ((chlen = wcwidth(CharOf(CHDEREF(ch)))) <= 0) { + if ((chlen = _nc_wacs_width(CharOf(CHDEREF(ch)))) <= 0) { static const NCURSES_CH_T blank = NewChar(BLANK_TEXT); /* diff --git a/ncurses/widechar/lib_add_wch.c b/ncurses/widechar/lib_add_wch.c index a55c2fea..c780466f 100644 --- a/ncurses/widechar/lib_add_wch.c +++ b/ncurses/widechar/lib_add_wch.c @@ -39,7 +39,7 @@ #include #endif -MODULE_ID("$Id: lib_add_wch.c,v 1.14 2019/01/19 15:46:25 tom Exp $") +MODULE_ID("$Id: lib_add_wch.c,v 1.15 2019/05/04 20:31:31 tom Exp $") /* clone/adapt lib_addch.c */ static const cchar_t blankchar = NewChar(BLANK_TEXT); @@ -195,7 +195,7 @@ wadd_wch_literal(WINDOW *win, cchar_t ch) * adjustments. */ { - int len = wcwidth(CharOf(ch)); + int len = _nc_wacs_width(CharOf(ch)); int i; int j; wchar_t *chars; diff --git a/ncurses/widechar/lib_cchar.c b/ncurses/widechar/lib_cchar.c index b465c360..58a3b940 100644 --- a/ncurses/widechar/lib_cchar.c +++ b/ncurses/widechar/lib_cchar.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2001-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 2001-2017,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -35,7 +35,7 @@ #include -MODULE_ID("$Id: lib_cchar.c,v 1.31 2017/03/31 11:14:26 tom Exp $") +MODULE_ID("$Id: lib_cchar.c,v 1.32 2019/05/04 20:46:24 tom Exp $") /* * The SuSv2 description leaves some room for interpretation. We'll assume wch @@ -60,7 +60,7 @@ setcchar(cchar_t *wcval, set_extended_pair(opts, color_pair); if (wch == NULL - || ((len = (unsigned) wcslen(wch)) > 1 && wcwidth(wch[0]) < 0) + || ((len = (unsigned) wcslen(wch)) > 1 && _nc_wacs_width(wch[0]) < 0) || color_pair < 0) { code = ERR; } else { @@ -74,7 +74,7 @@ setcchar(cchar_t *wcval, * are only interested in adding non-spacing characters. */ for (i = 1; i < len; ++i) { - if (wcwidth(wch[i]) != 0) { + if (_nc_wacs_width(wch[i]) != 0) { len = i; break; } diff --git a/ncurses/widechar/lib_ins_wch.c b/ncurses/widechar/lib_ins_wch.c index 57f142b7..12dc19c2 100644 --- a/ncurses/widechar/lib_ins_wch.c +++ b/ncurses/widechar/lib_ins_wch.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2002-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 2002-2017,2019 Free Software Foundation, Inc. * * * * Permission is hereby granted, free of charge, to any person obtaining a * * copy of this software and associated documentation files (the * @@ -39,7 +39,7 @@ #include -MODULE_ID("$Id: lib_ins_wch.c,v 1.22 2017/04/08 22:52:26 tom Exp $") +MODULE_ID("$Id: lib_ins_wch.c,v 1.23 2019/05/04 20:46:24 tom Exp $") /* * Insert the given character, updating the current location to simplify @@ -48,7 +48,7 @@ MODULE_ID("$Id: lib_ins_wch.c,v 1.22 2017/04/08 22:52:26 tom Exp $") NCURSES_EXPORT(int) _nc_insert_wch(WINDOW *win, const cchar_t *wch) { - int cells = wcwidth(CharOf(CHDEREF(wch))); + int cells = _nc_wacs_width(CharOf(CHDEREF(wch))); int code = OK; if (cells < 0) { @@ -120,7 +120,7 @@ wins_nwstr(WINDOW *win, const wchar_t *wstr, int n) NCURSES_SIZE_T ox = win->_curx; for (cp = wstr; ((cp - wstr) < n) && *cp; cp++) { - int len = wcwidth(*cp); + int len = _nc_wacs_width(*cp); if ((len >= 0 && len != 1) || !is7bits(*cp)) { cchar_t tmp_cchar; diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 5dac05f8..bce2e0f5 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190427) unstable; urgency=low +ncurses6 (6.1+20190504) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 21 Apr 2019 08:56:30 -0400 + -- Thomas E. Dickey Sat, 04 May 2019 06:02:52 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 5dac05f8..bce2e0f5 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190427) unstable; urgency=low +ncurses6 (6.1+20190504) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 21 Apr 2019 08:56:30 -0400 + -- Thomas E. Dickey Sat, 04 May 2019 06:02:52 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index a7fed8cf..e5f12789 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20190427) unstable; urgency=low +ncurses6 (6.1+20190504) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sun, 21 Apr 2019 08:56:30 -0400 + -- Thomas E. Dickey Sat, 04 May 2019 06:02:52 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index cc30424f..2c248594 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.326 2019/04/21 12:56:30 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.327 2019/05/04 10:02:52 tom Exp $ ; TODO add examples ; TODO bump ABI to 6 @@ -10,7 +10,7 @@ !define VERSION_MAJOR "6" !define VERSION_MINOR "1" !define VERSION_YYYY "2019" -!define VERSION_MMDD "0427" +!define VERSION_MMDD "0504" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index cab83d3c..bf86325d 100644 --- a/package/mingw-ncurses.spec +++ b/package/mingw-ncurses.spec @@ -3,7 +3,7 @@ Summary: shared libraries for terminal handling Name: mingw32-ncurses6 Version: 6.1 -Release: 20190427 +Release: 20190504 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.map b/package/ncurses.map index c26b419d..85230f6c 100644 --- a/package/ncurses.map +++ b/package/ncurses.map @@ -1,4 +1,4 @@ -# $Id: ncurses.map,v 1.46 2019/03/16 23:13:28 tom Exp $ +# $Id: ncurses.map,v 1.47 2019/05/04 22:35:46 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -1197,6 +1197,7 @@ NCURSES_TINFO_6.1.current { global: _nc_find_user_entry; _nc_fmt_funcptr; + _nc_wacs_width; local: _*; } NCURSES_TINFO_6.1.20171230; diff --git a/package/ncurses.spec b/package/ncurses.spec index 893e2e64..79510b61 100644 --- a/package/ncurses.spec +++ b/package/ncurses.spec @@ -1,7 +1,7 @@ Summary: shared libraries for terminal handling Name: ncurses6 Version: 6.1 -Release: 20190427 +Release: 20190504 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.sym b/package/ncurses.sym index c5496d6b..76e6c0f2 100644 --- a/package/ncurses.sym +++ b/package/ncurses.sym @@ -1,4 +1,4 @@ -# $Id: ncurses.sym,v 1.32 2018/12/16 00:10:45 tom Exp $ +# $Id: ncurses.sym,v 1.33 2019/05/04 21:54:44 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -110,6 +110,7 @@ _nc_fallback _nc_fallback2 _nc_find_entry _nc_find_type_entry +_nc_find_user_entry _nc_first_db _nc_first_name _nc_flush @@ -235,6 +236,7 @@ _nc_visbuf _nc_visbuf2 _nc_visbufn _nc_viscbuf +_nc_wacs_width _nc_warning _nc_write_entry _nc_write_object diff --git a/package/ncursest.map b/package/ncursest.map index 782b039e..838ee7cf 100644 --- a/package/ncursest.map +++ b/package/ncursest.map @@ -1,4 +1,4 @@ -# $Id: ncursest.map,v 1.44 2019/03/16 23:14:03 tom Exp $ +# $Id: ncursest.map,v 1.45 2019/05/04 22:36:26 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -482,6 +482,7 @@ NCURSES_TINFO_6.1.current { global: _nc_find_user_entry; _nc_fmt_funcptr; + _nc_wacs_width; local: _*; } NCURSES_TINFO_6.1.20171230; diff --git a/package/ncursest.spec b/package/ncursest.spec index 1cb27871..77bb65f0 100644 --- a/package/ncursest.spec +++ b/package/ncursest.spec @@ -1,7 +1,7 @@ Summary: Curses library with POSIX thread support. Name: ncursest6 Version: 6.1 -Release: 20190427 +Release: 20190504 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.sym b/package/ncursest.sym index 1f75b806..f9ba0dde 100644 --- a/package/ncursest.sym +++ b/package/ncursest.sym @@ -1,4 +1,4 @@ -# $Id: ncursest.sym,v 1.36 2018/12/16 00:10:45 tom Exp $ +# $Id: ncursest.sym,v 1.37 2019/05/04 22:29:26 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -70,13 +70,17 @@ _nc_access _nc_acs_map _nc_add_to_try _nc_align_termtype +_nc_alloc_entry_leaks _nc_basename _nc_boolcodes _nc_boolfnames _nc_boolnames _nc_capcmp +_nc_captoinfo_leaks +_nc_check_termtype _nc_check_termtype2 _nc_codes_leaks +_nc_comp_scan_leaks _nc_copy_termtype _nc_copy_termtype2 _nc_count_outchars @@ -102,6 +106,7 @@ _nc_fallback2 _nc_find_entry _nc_find_prescr _nc_find_type_entry +_nc_find_user_entry _nc_first_db _nc_first_name _nc_flush @@ -114,6 +119,7 @@ _nc_free_termtype _nc_free_termtype2 _nc_free_tic _nc_free_tinfo +_nc_free_tparm _nc_freeall _nc_get_alias_table _nc_get_hash_table @@ -139,6 +145,7 @@ _nc_is_abs_path _nc_is_dir_path _nc_is_file_path _nc_keep_tic_dir +_nc_keyname_leaks _nc_keypad _nc_last_db _nc_leaks_tinfo @@ -176,6 +183,7 @@ _nc_read_entry_source _nc_read_file_entry _nc_read_termtype _nc_reset_input +_nc_resolve_uses _nc_resolve_uses2 _nc_retrace_attr_t _nc_retrace_bool @@ -219,6 +227,7 @@ _nc_suppress_warnings _nc_syntax _nc_syserr_abort _nc_tail +_nc_tgetent_leaks _nc_tic_dir _nc_tic_expand _nc_tic_written @@ -228,6 +237,7 @@ _nc_tinfo_fkeysf _nc_tparm_analyze _nc_tparm_err _nc_trace_buf +_nc_trace_bufcat _nc_tracechar _nc_tracing _nc_trans_string @@ -241,11 +251,13 @@ _nc_visbuf _nc_visbuf2 _nc_visbufn _nc_viscbuf +_nc_wacs_width _nc_warning _nc_write_entry _nc_write_object _traceattr _traceattr2 +_tracechar _tracechtype _tracechtype2 _tracef diff --git a/package/ncursestw.map b/package/ncursestw.map index 66f0ee86..836c64a2 100644 --- a/package/ncursestw.map +++ b/package/ncursestw.map @@ -1,4 +1,4 @@ -# $Id: ncursestw.map,v 1.46 2019/03/16 23:14:03 tom Exp $ +# $Id: ncursestw.map,v 1.47 2019/05/04 22:36:56 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -488,6 +488,7 @@ NCURSES_TINFO_6.1.current { global: _nc_find_user_entry; _nc_fmt_funcptr; + _nc_wacs_width; local: _*; } NCURSES_TINFO_6.1.20171230; diff --git a/package/ncursestw.sym b/package/ncursestw.sym index bfabcd81..f5d1ca45 100644 --- a/package/ncursestw.sym +++ b/package/ncursestw.sym @@ -1,4 +1,4 @@ -# $Id: ncursestw.sym,v 1.35 2018/12/16 00:10:45 tom Exp $ +# $Id: ncursestw.sym,v 1.36 2019/05/04 22:29:12 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -70,13 +70,17 @@ _nc_access _nc_acs_map _nc_add_to_try _nc_align_termtype +_nc_alloc_entry_leaks _nc_basename _nc_boolcodes _nc_boolfnames _nc_boolnames _nc_capcmp +_nc_captoinfo_leaks +_nc_check_termtype _nc_check_termtype2 _nc_codes_leaks +_nc_comp_scan_leaks _nc_copy_termtype _nc_copy_termtype2 _nc_count_outchars @@ -102,6 +106,7 @@ _nc_fallback2 _nc_find_entry _nc_find_prescr _nc_find_type_entry +_nc_find_user_entry _nc_first_db _nc_first_name _nc_flush @@ -114,6 +119,7 @@ _nc_free_termtype _nc_free_termtype2 _nc_free_tic _nc_free_tinfo +_nc_free_tparm _nc_freeall _nc_get_alias_table _nc_get_hash_table @@ -139,6 +145,7 @@ _nc_is_abs_path _nc_is_dir_path _nc_is_file_path _nc_keep_tic_dir +_nc_keyname_leaks _nc_keypad _nc_last_db _nc_leaks_tinfo @@ -176,6 +183,7 @@ _nc_read_entry_source _nc_read_file_entry _nc_read_termtype _nc_reset_input +_nc_resolve_uses _nc_resolve_uses2 _nc_retrace_attr_t _nc_retrace_bool @@ -219,6 +227,7 @@ _nc_suppress_warnings _nc_syntax _nc_syserr_abort _nc_tail +_nc_tgetent_leaks _nc_tic_dir _nc_tic_expand _nc_tic_written @@ -228,6 +237,7 @@ _nc_tinfo_fkeysf _nc_tparm_analyze _nc_tparm_err _nc_trace_buf +_nc_trace_bufcat _nc_tracechar _nc_tracing _nc_trans_string @@ -245,6 +255,7 @@ _nc_viswbuf _nc_viswbufn _nc_viswibuf _nc_wacs +_nc_wacs_width _nc_warning _nc_wcrtomb _nc_write_entry @@ -253,6 +264,7 @@ _traceattr _traceattr2 _tracecchar_t _tracecchar_t2 +_tracechar _tracechtype _tracechtype2 _tracef diff --git a/package/ncursesw.map b/package/ncursesw.map index 8f20acc9..6474c689 100644 --- a/package/ncursesw.map +++ b/package/ncursesw.map @@ -1,4 +1,4 @@ -# $Id: ncursesw.map,v 1.49 2019/03/16 23:14:03 tom Exp $ +# $Id: ncursesw.map,v 1.50 2019/05/04 22:37:14 tom Exp $ # script for shared library symbol-versioning using ld # # This file was generated by ncu-mapsyms @@ -482,6 +482,7 @@ NCURSES_TINFO_6.1.current { global: _nc_find_user_entry; _nc_fmt_funcptr; + _nc_wacs_width; local: _*; } NCURSES_TINFO_6.1.20171230; diff --git a/package/ncursesw.sym b/package/ncursesw.sym index ba60357a..65f09c96 100644 --- a/package/ncursesw.sym +++ b/package/ncursesw.sym @@ -1,4 +1,4 @@ -# $Id: ncursesw.sym,v 1.34 2018/12/16 00:10:45 tom Exp $ +# $Id: ncursesw.sym,v 1.35 2019/05/04 21:54:38 tom Exp $ # script for shared library symbol-visibility using libtool # # This file was generated by ncu-mapsyms @@ -106,6 +106,7 @@ _nc_fallback _nc_fallback2 _nc_find_entry _nc_find_type_entry +_nc_find_user_entry _nc_first_db _nc_first_name _nc_flush @@ -231,6 +232,7 @@ _nc_visbuf _nc_visbuf2 _nc_visbufn _nc_viscbuf +_nc_wacs_width _nc_viswbuf _nc_viswbufn _nc_viswibuf diff --git a/progs/tic.c b/progs/tic.c index 33d1311e..e0dab070 100644 --- a/progs/tic.c +++ b/progs/tic.c @@ -48,7 +48,7 @@ #include #include -MODULE_ID("$Id: tic.c,v 1.274 2019/04/20 20:28:19 tom Exp $") +MODULE_ID("$Id: tic.c,v 1.275 2019/05/04 14:41:06 tom Exp $") #define STDIN_NAME "" @@ -1200,6 +1200,8 @@ same_color(NCURSES_CONST char *oldcap, NCURSES_CONST char *newcap, int limit) static void check_colors(TERMTYPE2 *tp) { + char *value; + if ((max_colors > 0) != (max_pairs > 0) || ((max_colors > max_pairs) && (initialize_pair == 0))) _nc_warning("inconsistent values for max_colors (%d) and max_pairs (%d)", @@ -1248,6 +1250,15 @@ check_colors(TERMTYPE2 *tp) _nc_warning("expected ccc because initc is given"); } } + value = tigetstr("RGB"); + if (VALID_STRING(value)) { + int r, g, b; + char bad; + int code = sscanf(value, "%d/%d/%d%c", &r, &g, &b, &bad); + if (code != 3 || r <= 0 || g <= 0 || b <= 0) { + _nc_warning("unexpected value for RGB capability: %s", value); + } + } } static int