From 45a2b5bc1a4536173178e9907feb268c708797c7 Mon Sep 17 00:00:00 2001 From: "Thomas E. Dickey" Date: Sun, 16 May 2021 00:32:33 +0000 Subject: [PATCH] ncurses 6.2 - patch 20210515 + improve manual pages for wgetnstr, newwin (prompted by report/testcase by Bill Gray). is required for supporting the terminfo delay feature (report by --- NEWS | 8 +- VERSION | 2 +- dist.mk | 4 +- doc/html/man/adacurses6-config.1.html | 2 +- doc/html/man/captoinfo.1m.html | 2 +- doc/html/man/clear.1.html | 2 +- doc/html/man/curs_getstr.3x.html | 118 ++++++++++++++++---------- doc/html/man/curs_window.3x.html | 12 ++- doc/html/man/form.3x.html | 2 +- doc/html/man/infocmp.1m.html | 2 +- doc/html/man/infotocap.1m.html | 2 +- doc/html/man/menu.3x.html | 2 +- doc/html/man/ncurses.3x.html | 2 +- doc/html/man/ncurses6-config.1.html | 2 +- doc/html/man/panel.3x.html | 2 +- doc/html/man/tabs.1.html | 2 +- doc/html/man/terminfo.5.html | 2 +- doc/html/man/tic.1m.html | 2 +- doc/html/man/toe.1m.html | 2 +- doc/html/man/tput.1.html | 2 +- doc/html/man/tset.1.html | 2 +- man/curs_getstr.3x | 58 +++++++++++-- man/curs_window.3x | 31 ++++++- package/debian-mingw/changelog | 4 +- package/debian-mingw64/changelog | 4 +- package/debian/changelog | 4 +- package/mingw-ncurses.nsi | 4 +- package/mingw-ncurses.spec | 2 +- package/ncurses.spec | 2 +- package/ncursest.spec | 2 +- 30 files changed, 199 insertions(+), 88 deletions(-) diff --git a/NEWS b/NEWS index 16c3eabc..33efc1eb 100644 --- a/NEWS +++ b/NEWS @@ -26,7 +26,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.3662 2021/05/08 23:37:13 tom Exp $ +-- $Id: NEWS,v 1.3665 2021/05/15 23:59:31 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -46,10 +46,14 @@ 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. +20210515 + + improve manual pages for wgetnstr, newwin (prompted by + report/testcase by Bill Gray). + 20210508 + modify tputs' error check to allow it to be used without first calling tgetent or setupterm, noting that terminfo initialization - is requires for supporting the terminfo delay feature (report by + is required for supporting the terminfo delay feature (report by Sebastiano Vigna). + fix several warnings from clang --analyze + add null-pointer check in comp_parse.c, when a "use=" clause refers diff --git a/VERSION b/VERSION index 168b7e9d..e425a978 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:10 6.2 20210508 +5:0:10 6.2 20210515 diff --git a/dist.mk b/dist.mk index 372897a3..dd0fcf47 100644 --- a/dist.mk +++ b/dist.mk @@ -26,7 +26,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1414 2021/05/08 13:20:24 tom Exp $ +# $Id: dist.mk,v 1.1415 2021/05/15 09:37:23 tom Exp $ # Makefile for creating ncurses distributions. # # This only needs to be used directly as a makefile by developers, but @@ -38,7 +38,7 @@ SHELL = /bin/sh # These define the major/minor/patch versions of ncurses. NCURSES_MAJOR = 6 NCURSES_MINOR = 2 -NCURSES_PATCH = 20210508 +NCURSES_PATCH = 20210515 # We don't append the patch to the version, since this only applies to releases VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR) diff --git a/doc/html/man/adacurses6-config.1.html b/doc/html/man/adacurses6-config.1.html index 29bfeef6..64d556b8 100644 --- a/doc/html/man/adacurses6-config.1.html +++ b/doc/html/man/adacurses6-config.1.html @@ -126,7 +126,7 @@

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html
index 94db436c..bcbc7582 100644
--- a/doc/html/man/captoinfo.1m.html
+++ b/doc/html/man/captoinfo.1m.html
@@ -199,7 +199,7 @@
 

SEE ALSO

        infocmp(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 

AUTHOR

diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html
index 84038a53..c08bcaf8 100644
--- a/doc/html/man/clear.1.html
+++ b/doc/html/man/clear.1.html
@@ -150,7 +150,7 @@
 

SEE ALSO

        tput(1), terminfo(5)
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/curs_getstr.3x.html b/doc/html/man/curs_getstr.3x.html
index 5d8a2c0e..efca02f3 100644
--- a/doc/html/man/curs_getstr.3x.html
+++ b/doc/html/man/curs_getstr.3x.html
@@ -1,6 +1,6 @@
 
 
 
@@ -88,6 +88,14 @@
 
        A new full-screen window is created by calling newwin(0,0,0,0).
 
+       Regardless of the function  used  for  creating  a  new  window  (e.g.,
+       newwin, subwin, derwin, newpad), rather than a duplicate (with dupwin),
+       all of the window modes are initialized to the default  values.   These
+       functions set window modes after a window is created:
+
+              idcok, idlok, immedok, keypad, leaveok, nodelay, scrollok,
+              setscrreg, syncok, wbkgdset, wbkgrndset, and wtimeout
+
 
 

delwin

        Calling delwin deletes the named window, freeing all memory  associated
diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html
index 22bcb8f5..df81cd50 100644
--- a/doc/html/man/form.3x.html
+++ b/doc/html/man/form.3x.html
@@ -248,7 +248,7 @@
        curses(3x) and related pages whose names  begin  "form_"  for  detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html
index ebc65762..4ecba86d 100644
--- a/doc/html/man/infocmp.1m.html
+++ b/doc/html/man/infocmp.1m.html
@@ -514,7 +514,7 @@
 
        https://invisible-island.net/ncurses/tctest.html
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 

AUTHOR

diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html
index 9660eca5..2542d9f7 100644
--- a/doc/html/man/infotocap.1m.html
+++ b/doc/html/man/infotocap.1m.html
@@ -91,7 +91,7 @@
 

SEE ALSO

        infocmp(1m), tic(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 

AUTHOR

diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html
index 224bbbe6..f68443e2 100644
--- a/doc/html/man/menu.3x.html
+++ b/doc/html/man/menu.3x.html
@@ -223,7 +223,7 @@
        curses(3x) and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html
index bb634834..bfb84f38 100644
--- a/doc/html/man/ncurses.3x.html
+++ b/doc/html/man/ncurses.3x.html
@@ -60,7 +60,7 @@
        method of updating  character  screens  with  reasonable  optimization.
        This  implementation  is  "new  curses"  (ncurses)  and is the approved
        replacement for 4.4BSD classic curses,  which  has  been  discontinued.
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
        The  ncurses  library emulates the curses library of System V Release 4
        UNIX, and XPG4 (X/Open Portability Guide) curses  (also  known  as  XSI
diff --git a/doc/html/man/ncurses6-config.1.html b/doc/html/man/ncurses6-config.1.html
index a9622620..428959e4 100644
--- a/doc/html/man/ncurses6-config.1.html
+++ b/doc/html/man/ncurses6-config.1.html
@@ -113,7 +113,7 @@
 

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html
index 38221053..f69e23b4 100644
--- a/doc/html/man/panel.3x.html
+++ b/doc/html/man/panel.3x.html
@@ -281,7 +281,7 @@
 

SEE ALSO

        curses(3x), curs_variables(3x),
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 

AUTHOR

diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html
index 4355d499..f49d6d1c 100644
--- a/doc/html/man/tabs.1.html
+++ b/doc/html/man/tabs.1.html
@@ -207,7 +207,7 @@
 

SEE ALSO

        infocmp(1m), tset(1), curses(3x), terminfo(5).
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
index 4f93c173..a10ea2f2 100644
--- a/doc/html/man/terminfo.5.html
+++ b/doc/html/man/terminfo.5.html
@@ -106,7 +106,7 @@
        have, by specifying how to perform screen operations, and by specifying
        padding requirements and initialization sequences.
 
-       This manual describes ncurses version 6.2 (patch 20210403).
+       This manual describes ncurses version 6.2 (patch 20210515).
 
 
 

Terminfo Entry Syntax

diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html
index e2919ced..2bf4f51a 100644
--- a/doc/html/man/tic.1m.html
+++ b/doc/html/man/tic.1m.html
@@ -461,7 +461,7 @@
        captoinfo(1m),   infocmp(1m),   infotocap(1m),   toe(1m),   curses(3x),
        term(5).  terminfo(5).  user_caps(5).
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 

AUTHOR

diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html
index 7325fab9..8edd0ce3 100644
--- a/doc/html/man/toe.1m.html
+++ b/doc/html/man/toe.1m.html
@@ -171,7 +171,7 @@
        captoinfo(1m),   infocmp(1m),   infotocap(1m),   tic(1m),   curses(3x),
        terminfo(5).
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html
index bd3ff9b1..98234a9c 100644
--- a/doc/html/man/tput.1.html
+++ b/doc/html/man/tput.1.html
@@ -526,7 +526,7 @@
 

SEE ALSO

        clear(1), stty(1), tabs(1), tset(1), curs_termcap(3x), terminfo(5).
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html
index 465fb596..db6272e1 100644
--- a/doc/html/man/tset.1.html
+++ b/doc/html/man/tset.1.html
@@ -391,7 +391,7 @@
        csh(1),   sh(1),   stty(1),   curs_terminfo(3x),  tty(4),  terminfo(5),
        ttys(5), environ(7)
 
-       This describes ncurses version 6.2 (patch 20210403).
+       This describes ncurses version 6.2 (patch 20210515).
 
 
 
diff --git a/man/curs_getstr.3x b/man/curs_getstr.3x
index baf56967..15794495 100644
--- a/man/curs_getstr.3x
+++ b/man/curs_getstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright 2018-2019,2020 Thomas E. Dickey                                *
+.\" Copyright 2018-2020,2021 Thomas E. Dickey                                *
 .\" Copyright 1998-2010,2017 Free Software Foundation, Inc.                  *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_getstr.3x,v 1.31 2020/10/18 00:27:44 tom Exp $
+.\" $Id: curs_getstr.3x,v 1.32 2021/05/15 23:37:18 tom Exp $
 .TH curs_getstr 3X ""
 .ie \n(.g .ds `` \(lq
 .el       .ds `` ``
@@ -80,19 +80,29 @@ The resulting value is placed in the
 area pointed to by the character pointer \fIstr\fR,
 followed by a NUL.
 .PP
-\fBwgetnstr\fR reads at most \fIn\fR characters, thus preventing a possible
+The \fBgetnstr\fR function reads
+from the \fIstdscr\fR default window.
+The other functions, such as \fBwgetnstr\fP,
+read from the window given as a parameter.
+.PP
+\fBgetnstr\fR reads at most \fIn\fR characters, thus preventing a possible
 overflow of the input buffer.
 Any attempt to enter more characters (other
 than the terminating newline or carriage return) causes a beep.
 Function
 keys also cause a beep and are ignored.
-The \fBgetnstr\fR function reads
-from the \fIstdscr\fR default window.
 .PP
-The user's erase and kill characters are interpreted.
-If keypad
-mode is on for the window, \fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR
-are both considered equivalent to the user's kill character.
+The user's \fIerase\fP and \fIkill\fP characters are interpreted:
+.bP
+The \fIerase\fP character (e.g., \fB^H\fP) erases the character
+at the end of the buffer, moving the cursor to the left.
+.IP
+If \fIkeypad\fP mode is on for the window,
+\fBKEY_LEFT\fR and \fBKEY_BACKSPACE\fR
+are both considered equivalent to the user's erase character.
+.bP
+The \fIkill\fP character (e.g., \fB^U\fP) erases the entire buffer,
+leaving the cursor at the beginning of the buffer.
 .PP
 Characters input are echoed only if \fBecho\fR is currently on.
 In that case,
@@ -187,7 +197,37 @@ which the \fBsysconf\fP function may provide.
 If neither \fBLINE_MAX\fP or \fBsysconf\fP is available,
 ncurses uses the POSIX value for \fBLINE_MAX\fP (a 2048 byte limit).
 In either case, it reserves a byte for the terminating NUL.
+.PP
+Although \fBgetnstr\fP is equivalent to a series of calls to \fBgetch\fP,
+it also makes changes to the curses modes to allow simple editing of
+the input buffer:
+.bP
+\fBgetnstr\fP saves the current value of the \fBnl\fP, \fBecho\fP,
+\fBraw\fP and \fBcbreak\fP modes, and sets
+\fBnl\fP,
+\fBnoecho\fP,
+\fBnoraw\fP, and
+\fBcbreak\fP.
+.IP
+\fBgetnstr\fP handles the echoing of characters,
+rather than relying on the caller to set an appropriate mode.
+.bP
+It also obtains the \fIerase\fP and \fIkill\fP characters
+from \fBerasechar\fP and \fBkillchar\fP, respectively.
+.bP
+On return, \fBgetnstr\fP restores the modes to their previous values.
+.PP
+Other implementations differ.
+While they may set the \fIecho\fP mode,
+they do not modify the \fIraw\fP mode, and may take the \fIcbreak\fP
+mode set by the caller into account when deciding whether to handle
+echoing within \fBgetnstr\fP or as a side-effect of the \fBgetch\fP calls.
+Because ncurses sets these modes,
+its signal handlers for INTR and QUIT
+(e.g., \fB^C\fP or \fB^\\\fP) may catch a signal and stop the program,
+where other implementations allow one to enter those characters in the buffer.
 .SH SEE ALSO
 \fBcurses\fR(3X),
 \fBcurs_getch\fR(3X),
+\fBcurs_termattrs\fR(3X),
 \fBcurs_variables\fR(3X).
diff --git a/man/curs_window.3x b/man/curs_window.3x
index 77cbffa7..66d72979 100644
--- a/man/curs_window.3x
+++ b/man/curs_window.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright 2020 Thomas E. Dickey                                          *
+.\" Copyright 2020,2021 Thomas E. Dickey                                     *
 .\" Copyright 1998-2015,2016 Free Software Foundation, Inc.                  *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -27,8 +27,12 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_window.3x,v 1.21 2020/02/02 23:34:34 tom Exp $
+.\" $Id: curs_window.3x,v 1.22 2021/05/15 23:57:14 tom Exp $
 .TH curs_window 3X ""
+.de bP
+.ie n  .IP \(bu 4
+.el    .IP \(bu 2
+..
 .na
 .hy 0
 .SH NAME
@@ -97,6 +101,29 @@ If either
 .RE
 .PP
 A new full-screen window is created by calling \fBnewwin(0,0,0,0)\fR.
+.PP
+Regardless of the function used for creating a new window
+(e.g., \fBnewwin\fP, \fBsubwin\fP, \fBderwin\fP, \fBnewpad\fP),
+rather than a duplicate (with \fBdupwin\fP),
+all of the window modes are initialized to the default values.
+These functions set window modes after a window is created:
+.RS
+.na
+.PP
+idcok,
+idlok,
+immedok,
+keypad,
+leaveok,
+nodelay,
+scrollok,
+setscrreg,                
+syncok,
+wbkgdset,
+wbkgrndset, and
+wtimeout
+.RE
+.ad
 .SS delwin
 .PP
 Calling \fBdelwin\fR deletes the named window, freeing all memory
diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog
index 91c778f8..58b6e102 100644
--- a/package/debian-mingw/changelog
+++ b/package/debian-mingw/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210508) unstable; urgency=low
+ncurses6 (6.2+20210515) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sat, 08 May 2021 09:20:24 -0400
+ -- Thomas E. Dickey   Sat, 15 May 2021 05:37:23 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog
index 91c778f8..58b6e102 100644
--- a/package/debian-mingw64/changelog
+++ b/package/debian-mingw64/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210508) unstable; urgency=low
+ncurses6 (6.2+20210515) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sat, 08 May 2021 09:20:24 -0400
+ -- Thomas E. Dickey   Sat, 15 May 2021 05:37:23 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian/changelog b/package/debian/changelog
index c78ce2e7..c8d8acd9 100644
--- a/package/debian/changelog
+++ b/package/debian/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210508) unstable; urgency=low
+ncurses6 (6.2+20210515) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sat, 08 May 2021 09:20:24 -0400
+ -- Thomas E. Dickey   Sat, 15 May 2021 05:37:23 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi
index 90a791dc..27228adf 100644
--- a/package/mingw-ncurses.nsi
+++ b/package/mingw-ncurses.nsi
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.457 2021/05/08 13:20:24 tom Exp $
+; $Id: mingw-ncurses.nsi,v 1.458 2021/05/15 09:37:23 tom Exp $
 
 ; TODO add examples
 ; TODO bump ABI to 6
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"
 !define VERSION_MINOR "2"
 !define VERSION_YYYY  "2021"
-!define VERSION_MMDD  "0508"
+!define VERSION_MMDD  "0515"
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
 
 !define MY_ABI   "5"
diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec
index 4bd7e182..1c31248b 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.2
-Release: 20210508
+Release: 20210515
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/package/ncurses.spec b/package/ncurses.spec
index a8753c49..57b0bca3 100644
--- a/package/ncurses.spec
+++ b/package/ncurses.spec
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20210508
+Release: 20210515
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/package/ncursest.spec b/package/ncursest.spec
index 1bc1937d..7a09666b 100644
--- a/package/ncursest.spec
+++ b/package/ncursest.spec
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20210508
+Release: 20210515
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
-- 
2.45.0