From: Thomas E. Dickey Date: Sun, 9 Sep 2018 01:14:35 +0000 (+0000) Subject: ncurses 6.1 - patch 20180908 X-Git-Tag: v6.2~73 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=093902b4199bbc1d9afec433759e48344c06ed1a;hp=30393be892025f03322b7907a04cc05cc08e8760 ncurses 6.1 - patch 20180908 + document --with-pcre2 configure option in INSTALL. + improve workaround for special case in PutAttrChar() where a cell is marked as alternate-character set, to handle a case where the character in the cell does not correspond to any of the ASCII fallbacks (report by Leon Winter, cf: 20180505). + amend change to form library which attempted to avoid unnecessary update of cursor position in non-public fields, to simply disable output in this case (patch by Leon Winter, cf: 20180414). + improve check for LINE_MAX runtime limit, to accommodate broken implementations of sysconf(). --- diff --git a/INSTALL b/INSTALL index e57bbec7..bf1fead6 100644 --- a/INSTALL +++ b/INSTALL @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: INSTALL,v 1.206 2018/08/18 20:41:07 tom Exp $ +-- $Id: INSTALL,v 1.211 2018/09/08 23:28:11 tom Exp $ --------------------------------------------------------------------- How to install Ncurses/Terminfo on your system --------------------------------------------------------------------- @@ -678,13 +678,6 @@ SUMMARY OF CONFIGURE OPTIONS: vsnprintf() or vsprintf(). It is slow, however, and is used only on very old systems which lack vsnprintf(). - --enable-sigwinch - Compile support for ncurses' SIGWINCH handler. If your application has - its own SIGWINCH handler, ncurses will not use its own. The ncurses - handler causes wgetch() to return KEY_RESIZE when the screen-size - changes. This option is the default, unless you have disabled the - extended functions. - --enable-signed-char The term.h header declares a Booleans[] array typed "char". But it stores signed values there and "char" is not necessarily signed. @@ -692,6 +685,13 @@ SUMMARY OF CONFIGURE OPTIONS: is not strictly compatible. This option allows one to implement this alteration without patching the source code. + --enable-sigwinch + Compile support for ncurses' SIGWINCH handler. If your application has + its own SIGWINCH handler, ncurses will not use its own. The ncurses + handler causes wgetch() to return KEY_RESIZE when the screen-size + changes. This option is the default, unless you have disabled the + extended functions. + --enable-sp-funcs Compile-in support for extended functions which accept a SCREEN pointer, reducing the need for juggling the global SP value with set_term() and @@ -794,10 +794,6 @@ SUMMARY OF CONFIGURE OPTIONS: correspond with that in , or defaults to platform-specific sizes). - --with-build-cpp=XXX - This option is provided by the same macro used for $BUILD_CC, etc., - but is not directly used by ncurses. - --with-build-cc=XXX If cross-compiling, specify a host C compiler, which is needed to compile a few utilities which generate source modules for ncurses. @@ -812,6 +808,10 @@ SUMMARY OF CONFIGURE OPTIONS: You can also set the environment variable $BUILD_CFLAGS rather than use this option. + --with-build-cpp=XXX + This option is provided by the same macro used for $BUILD_CC, etc., + but is not directly used by ncurses. + --with-build-cppflags=XXX If cross-compiling, specify the host C preprocessor-flags. You might need to do this if the target compiler has unusual flags which confuse @@ -995,9 +995,6 @@ SUMMARY OF CONFIGURE OPTIONS: https://invisible-island.net/autoconf/ --with-libtool-opts=XXX - Specify additional libtool options. - - --with-libtool-opts Allow user to pass additional libtool options into the library creation and link steps. The main use for this is to do something like ./configure --with-libtool-opts=-static @@ -1068,6 +1065,15 @@ SUMMARY OF CONFIGURE OPTIONS: and corresponding package names to separate unusual configurations. If no option value is given (or if it is "none"), no suffix is added. + --with-pcre2 + Add PCRE2 (Perl-compatible regular expressions v2) to the build if it + is available and the user requests it. Assume the application will + otherwise use the POSIX interface. + + This is useful for MinGW builds because the usual POSIX interface is + not supplied by the development environment, while ncurses' form + library uses a regular expression feature for one of the field types. + --with-pkg-config=[DIR] Check for pkg-config, optionally specifying its path. @@ -1195,6 +1201,10 @@ SUMMARY OF CONFIGURE OPTIONS: Configure the trace() function as part of the all models of the ncurses library. Normally it is part of the debug (libncurses_g) library only. + --with-valgrind + For testing, compile with debug option. + This also sets the --disable-leaks option. + --with-versioned-syms[=XXX] The Solaris, GNU and reportedly some other linkers (ld) accept a "--version-script" option which tells the linker to annotate the @@ -1226,18 +1236,6 @@ SUMMARY OF CONFIGURE OPTIONS: may prefer to use a different ".map" file by setting this option's value. - --with-xterm-kbs=XXX - Configure xterm's terminfo entries to use either BS (^H, i.e., ASCII - backspace) or DEL (^?, or 127). XXX can be BS (or bs, 8) or DEL - (or del, 127). - - During installation, the makefile and scripts modifies the "xterm+kbs" - terminfo entry to use this setting. - - --with-valgrind - For testing, compile with debug option. - This also sets the --disable-leaks option. - --with-wrap-prefix=XXX When using the --enable-reentrant option, ncurses redefines variables that would be global in curses, e.g., LINES, as a macro that calls a @@ -1254,6 +1252,14 @@ SUMMARY OF CONFIGURE OPTIONS: This overrides a configure check which usually works, but is needed due to the lack of standardization for X11's files. + --with-xterm-kbs=XXX + Configure xterm's terminfo entries to use either BS (^H, i.e., ASCII + backspace) or DEL (^?, or 127). XXX can be BS (or bs, 8) or DEL + (or del, 127). + + During installation, the makefile and scripts modifies the "xterm+kbs" + terminfo entry to use this setting. + --without-ada Suppress the configure script's check for Ada95, do not build the Ada95 binding and related demo. diff --git a/NEWS b/NEWS index 528eebec..f3a01908 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.3180 2018/09/01 20:25:49 tom Exp $ +-- $Id: NEWS,v 1.3185 2018/09/08 23:29:00 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,18 @@ 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. +20180908 + + document --with-pcre2 configure option in INSTALL. + + improve workaround for special case in PutAttrChar() where a cell is + marked as alternate-character set, to handle a case where the + character in the cell does not correspond to any of the ASCII + fallbacks (report by Leon Winter, cf: 20180505). + + amend change to form library which attempted to avoid unnecessary + update of cursor position in non-public fields, to simply disable + output in this case (patch by Leon Winter, cf: 20180414). + + improve check for LINE_MAX runtime limit, to accommodate broken + implementations of sysconf(). + 20180901 + improve manual page for wgetnstr, giving background for the length parameter. diff --git a/VERSION b/VERSION index 64b3b09f..809a5c17 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.1 20180901 +5:0:10 6.1 20180908 diff --git a/dist.mk b/dist.mk index d43b23ea..c0884de6 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.1239 2018/09/01 15:02:50 tom Exp $ +# $Id: dist.mk,v 1.1240 2018/09/08 14:15:19 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 = 20180901 +NCURSES_PATCH = 20180908 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/form/frm_driver.c b/form/frm_driver.c index b07ca7cd..9d0b7d3e 100644 --- a/form/frm_driver.c +++ b/form/frm_driver.c @@ -32,7 +32,7 @@ #include "form.priv.h" -MODULE_ID("$Id: frm_driver.c,v 1.126 2018/04/28 19:03:36 Leon.Winter Exp $") +MODULE_ID("$Id: frm_driver.c,v 1.127 2018/09/08 19:03:39 tom Exp $") /*---------------------------------------------------------------------------- This is the core module of the form library. It contains the majority @@ -830,7 +830,6 @@ _nc_Position_Form_Cursor(FORM *form) { FIELD *field; WINDOW *formwin; - int row, col; if (!form) return (E_BAD_ARGUMENT); @@ -841,17 +840,14 @@ _nc_Position_Form_Cursor(FORM *form) field = form->current; formwin = Get_Form_Window(form); - col = Field_Has_Option(field, O_PUBLIC) ? form->curcol : form->begincol; - row = Field_Has_Option(field, O_PUBLIC) ? form->currow : form->toprow; - - wmove(form->w, row, col); + wmove(form->w, form->currow, form->curcol); if (Has_Invisible_Parts(field)) { /* in this case fieldwin isn't derived from formwin, so we have to move the cursor in formwin by hand... */ wmove(formwin, - field->frow + row - form->toprow, - field->fcol + col - form->begincol); + field->frow + form->currow - form->toprow, + field->fcol + form->curcol - form->begincol); wcursyncup(formwin); } else @@ -876,6 +872,7 @@ _nc_Refresh_Current_Field(FORM *form) { WINDOW *formwin; FIELD *field; + bool is_public; T((T_CALLED("_nc_Refresh_Current_Field(%p)"), (void *)form)); @@ -888,103 +885,105 @@ _nc_Refresh_Current_Field(FORM *form) field = form->current; formwin = Get_Form_Window(form); - if (Field_Has_Option(field, O_PUBLIC)) + is_public = Field_Has_Option(field, O_PUBLIC); + + if (Is_Scroll_Field(field)) { - if (Is_Scroll_Field(field)) + /* Again, in this case the fieldwin isn't derived from formwin, + so we have to perform a copy operation. */ + if (Single_Line_Field(field)) { - /* Again, in this case the fieldwin isn't derived from formwin, - so we have to perform a copy operation. */ - if (Single_Line_Field(field)) - { - /* horizontal scrolling */ - if (form->curcol < form->begincol) - form->begincol = form->curcol; - else - { - if (form->curcol >= (form->begincol + field->cols)) - form->begincol = form->curcol - field->cols - + (move_after_insert ? 1 : 0); - } - copywin(form->w, - formwin, - 0, - form->begincol, - field->frow, - field->fcol, - field->frow, - field->cols + field->fcol - 1, - 0); - } + /* horizontal scrolling */ + if (form->curcol < form->begincol) + form->begincol = form->curcol; else { - /* A multi-line, i.e. vertical scrolling field */ - int row_after_bottom, first_modified_row, first_unmodified_row; + if (form->curcol >= (form->begincol + field->cols)) + form->begincol = form->curcol - field->cols + + (move_after_insert ? 1 : 0); + } + if (is_public) + copywin(form->w, + formwin, + 0, + form->begincol, + field->frow, + field->fcol, + field->frow, + field->cols + field->fcol - 1, + 0); + } + else + { + /* A multi-line, i.e. vertical scrolling field */ + int row_after_bottom, first_modified_row, first_unmodified_row; - if (field->drows > field->rows) + if (field->drows > field->rows) + { + row_after_bottom = form->toprow + field->rows; + if (form->currow < form->toprow) { - row_after_bottom = form->toprow + field->rows; - if (form->currow < form->toprow) - { - form->toprow = form->currow; - SetStatus(field, _NEWTOP); - } - if (form->currow >= row_after_bottom) - { - form->toprow = form->currow - field->rows + 1; - SetStatus(field, _NEWTOP); - } - if (field->status & _NEWTOP) - { - /* means we have to copy whole range */ - first_modified_row = form->toprow; - first_unmodified_row = first_modified_row + field->rows; - ClrStatus(field, _NEWTOP); - } - else - { - /* we try to optimize : finding the range of touched - lines */ - first_modified_row = form->toprow; - while (first_modified_row < row_after_bottom) - { - if (is_linetouched(form->w, first_modified_row)) - break; - first_modified_row++; - } - first_unmodified_row = first_modified_row; - while (first_unmodified_row < row_after_bottom) - { - if (!is_linetouched(form->w, first_unmodified_row)) - break; - first_unmodified_row++; - } - } + form->toprow = form->currow; + SetStatus(field, _NEWTOP); } - else + if (form->currow >= row_after_bottom) { + form->toprow = form->currow - field->rows + 1; + SetStatus(field, _NEWTOP); + } + if (field->status & _NEWTOP) + { + /* means we have to copy whole range */ first_modified_row = form->toprow; first_unmodified_row = first_modified_row + field->rows; + ClrStatus(field, _NEWTOP); + } + else + { + /* we try to optimize : finding the range of touched + lines */ + first_modified_row = form->toprow; + while (first_modified_row < row_after_bottom) + { + if (is_linetouched(form->w, first_modified_row)) + break; + first_modified_row++; + } + first_unmodified_row = first_modified_row; + while (first_unmodified_row < row_after_bottom) + { + if (!is_linetouched(form->w, first_unmodified_row)) + break; + first_unmodified_row++; + } } - if (first_unmodified_row != first_modified_row) - copywin(form->w, - formwin, - first_modified_row, - 0, - field->frow + first_modified_row - form->toprow, - field->fcol, - field->frow + first_unmodified_row - form->toprow - 1, - field->cols + field->fcol - 1, - 0); } - wsyncup(formwin); - } - else - { - /* if the field-window is simply a derived window, i.e. contains no - * invisible parts, the whole thing is trivial - */ - wsyncup(form->w); + else + { + first_modified_row = form->toprow; + first_unmodified_row = first_modified_row + field->rows; + } + if (first_unmodified_row != first_modified_row && is_public) + copywin(form->w, + formwin, + first_modified_row, + 0, + field->frow + first_modified_row - form->toprow, + field->fcol, + field->frow + first_unmodified_row - form->toprow - 1, + field->cols + field->fcol - 1, + 0); } + if (is_public) + wsyncup(formwin); + } + else + { + /* if the field-window is simply a derived window, i.e. contains no + * invisible parts, the whole thing is trivial + */ + if (is_public) + wsyncup(form->w); } untouchwin(form->w); returnCode(_nc_Position_Form_Cursor(form)); diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 16f05ae0..e90a5467 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -48,7 +48,7 @@ #include #endif -MODULE_ID("$Id: lib_setup.c,v 1.195 2018/09/01 21:16:23 tom Exp $") +MODULE_ID("$Id: lib_setup.c,v 1.196 2018/09/08 20:14:26 tom Exp $") /**************************************************************************** * @@ -715,12 +715,20 @@ TINFO_SETUP_TERM(TERMINAL **tp, "Not enough memory to create terminal structure.\n"); } #if HAVE_SYSCONF + { + long limit; #ifdef LINE_MAX - _nc_globals.getstr_limit = LINE_MAX; + limit = LINE_MAX; +#else + limit = _nc_globals.getstr_limit; #endif #ifdef _SC_LINE_MAX - _nc_globals.getstr_limit = sysconf(_SC_LINE_MAX); + if (limit < sysconf(_SC_LINE_MAX)) + limit = sysconf(_SC_LINE_MAX); #endif + if (_nc_globals.getstr_limit < (int) limit) + _nc_globals.getstr_limit = (int) limit; + } #endif /* HAVE_SYSCONF */ T(("using %d for getstr limit", _nc_globals.getstr_limit)); diff --git a/ncurses/tinfo/tinfo_driver.c b/ncurses/tinfo/tinfo_driver.c index f1c98ddf..4c6e0353 100644 --- a/ncurses/tinfo/tinfo_driver.c +++ b/ncurses/tinfo/tinfo_driver.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 2008-2016,2017 Free Software Foundation, Inc. * + * Copyright (c) 2008-2017,2018 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 * @@ -51,7 +51,7 @@ # endif #endif -MODULE_ID("$Id: tinfo_driver.c,v 1.59 2017/09/10 21:08:46 tom Exp $") +MODULE_ID("$Id: tinfo_driver.c,v 1.60 2018/09/08 21:11:49 tom Exp $") /* * SCO defines TIOCGSIZE and the corresponding struct. Other systems (SunOS, @@ -1082,8 +1082,13 @@ drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map) while (i + 1 < length) { if (acs_chars[i] != 0 && UChar(acs_chars[i]) < ACS_LEN) { real_map[UChar(acs_chars[i])] = UChar(acs_chars[i + 1]) | A_ALTCHARSET; - if (sp != 0) + T(("#%d real_map[%s] = %s", + (int) i, + _tracechar(UChar(acs_chars[i])), + _tracechtype(real_map[UChar(acs_chars[i])]))); + if (sp != 0) { sp->_screen_acs_map[UChar(acs_chars[i])] = TRUE; + } } i += 2; } @@ -1113,7 +1118,6 @@ drv_initacs(TERMINAL_CONTROL_BLOCK * TCB, chtype *real_map, chtype *fake_map) ? "DIFF" : "SAME"), _nc_visbuf(show)); - _nc_unlock_global(tracef); } #endif /* TRACE */ diff --git a/ncurses/tty/tty_update.c b/ncurses/tty/tty_update.c index fd35c47b..17f64113 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.298 2018/05/05 19:11:55 tom Exp $") +MODULE_ID("$Id: tty_update.c,v 1.299 2018/09/08 21:33:59 tom Exp $") /* * This define controls the line-breakout optimization. Every once in a @@ -373,9 +373,18 @@ PutAttrChar(NCURSES_SP_DCLx CARG_CH_T ch) } else #endif if (!SP_PARM->_screen_acs_map[c8]) { + /* + * If we found no mapping for a given alternate-character set item + * in the terminal description, attempt to use the ASCII fallback + * code which is populated in the _acs_map[] array. If that did + * not correspond to a line-drawing, etc., graphics character, the + * array entry would be empty. + */ chtype temp = UChar(SP_PARM->_acs_map[c8]); - RemAttr(attr, A_ALTCHARSET); - SetChar(my_ch, temp, AttrOf(attr)); + if (temp) { + RemAttr(attr, A_ALTCHARSET); + SetChar(my_ch, temp, AttrOf(attr)); + } } /* diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog index 1e4aaf20..48656bb6 100644 --- a/package/debian-mingw/changelog +++ b/package/debian-mingw/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20180901) unstable; urgency=low +ncurses6 (6.1+20180908) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 01 Sep 2018 11:02:50 -0400 + -- Thomas E. Dickey Sat, 08 Sep 2018 10:15:19 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog index 1e4aaf20..48656bb6 100644 --- a/package/debian-mingw64/changelog +++ b/package/debian-mingw64/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20180901) unstable; urgency=low +ncurses6 (6.1+20180908) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 01 Sep 2018 11:02:50 -0400 + -- Thomas E. Dickey Sat, 08 Sep 2018 10:15:19 -0400 ncurses6 (5.9-20131005) unstable; urgency=low diff --git a/package/debian/changelog b/package/debian/changelog index 5f1cb85c..39a86612 100644 --- a/package/debian/changelog +++ b/package/debian/changelog @@ -1,8 +1,8 @@ -ncurses6 (6.1+20180901) unstable; urgency=low +ncurses6 (6.1+20180908) unstable; urgency=low * latest weekly patch - -- Thomas E. Dickey Sat, 01 Sep 2018 11:02:50 -0400 + -- Thomas E. Dickey Sat, 08 Sep 2018 10:15:19 -0400 ncurses6 (5.9-20120608) unstable; urgency=low diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi index 6c1e9cb8..04b737a0 100644 --- a/package/mingw-ncurses.nsi +++ b/package/mingw-ncurses.nsi @@ -1,4 +1,4 @@ -; $Id: mingw-ncurses.nsi,v 1.286 2018/09/01 15:02:50 tom Exp $ +; $Id: mingw-ncurses.nsi,v 1.287 2018/09/08 14:15:19 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 "2018" -!define VERSION_MMDD "0901" +!define VERSION_MMDD "0908" !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD} !define MY_ABI "5" diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec index 04409b5e..fd89e74f 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: 20180901 +Release: 20180908 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncurses.spec b/package/ncurses.spec index c8a4aff7..e60ee53b 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: 20180901 +Release: 20180908 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz diff --git a/package/ncursest.spec b/package/ncursest.spec index 2257475b..42471d81 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: 20180901 +Release: 20180908 License: X11 Group: Development/Libraries Source: ncurses-%{version}-%{release}.tgz