]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.2 - patch 20211002
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 3 Oct 2021 00:30:14 +0000 (00:30 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 3 Oct 2021 00:30:14 +0000 (00:30 +0000)
+ use return-value from vsnprintf to reallocate as needed to allow for
  buffers larger than the screen size (report by "_RuRo_").
+ modify tset "-q" option to refrain from modifying terminal modes, to
  match the documentation.
+ add section on margins to terminfo.5, adapted from X/Open Curses.
+ make tput/tset warning messages consistently using alias names when
  those are used, rather than the underlying program's name.
+ improve tput usage message for aliases such as clear, by eliminating
  tput-specific portions.
+ add a check in toe to ensure that a "termcap file" is text rather
  than binary.
+ further build-fixes for OpenBSD 6.9, whose header files differ from
  the other BSDs.

38 files changed:
NEWS
VERSION
dist.mk
doc/html/man/adacurses6-config.1.html
doc/html/man/captoinfo.1m.html
doc/html/man/clear.1.html
doc/html/man/form.3x.html
doc/html/man/infocmp.1m.html
doc/html/man/infotocap.1m.html
doc/html/man/menu.3x.html
doc/html/man/ncurses.3x.html
doc/html/man/ncurses6-config.1.html
doc/html/man/panel.3x.html
doc/html/man/tabs.1.html
doc/html/man/terminfo.5.html
doc/html/man/tic.1m.html
doc/html/man/toe.1m.html
doc/html/man/tput.1.html
doc/html/man/tset.1.html
man/terminfo.tail
man/tput.1
ncurses/base/MKlib_gen.sh
ncurses/base/lib_color.c
ncurses/base/safe_sprintf.c
ncurses/term.priv.h
package/debian-mingw/changelog
package/debian-mingw64/changelog
package/debian/changelog
package/mingw-ncurses.nsi
package/mingw-ncurses.spec
package/ncurses.spec
package/ncursest.spec
progs/reset_cmd.c
progs/reset_cmd.h
progs/tic.c
progs/toe.c
progs/tput.c
progs/tset.c

diff --git a/NEWS b/NEWS
index 989bf2363a2e567feaf8ba6dc77f7b0a1adccbf9..fdb530d8a2e0edc75170fba7757327b689e049fd 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -26,7 +26,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3712 2021/09/24 19:45:04 tom Exp $
+-- $Id: NEWS,v 1.3717 2021/10/02 22:25:41 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,21 @@ 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.
 
+20211002
+       + use return-value from vsnprintf to reallocate as needed to allow for
+         buffers larger than the screen size (report by "_RuRo_").
+       + modify tset "-q" option to refrain from modifying terminal modes, to
+         match the documentation.
+       + add section on margins to terminfo.5, adapted from X/Open Curses.
+       + make tput/tset warning messages consistently using alias names when
+         those are used, rather than the underlying program's name.
+       + improve tput usage message for aliases such as clear, by eliminating
+         tput-specific portions.
+       + add a check in toe to ensure that a "termcap file" is text rather
+         than binary.
+       + further build-fixes for OpenBSD 6.9, whose header files differ from
+         the other BSDs.
+
 20210925
        + add kbeg to xterm+keypad to accommodate termcap applications -TD
        + add smglp and smgrp to vt420+lrmm, to provide useful data for the
diff --git a/VERSION b/VERSION
index 5280c093f7fd1a2b664eca002d45888c2b5ca561..b146b8e0befc3138e45b60072819df00666cf0cd 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.2     20210925
+5:0:10 6.2     20211002
diff --git a/dist.mk b/dist.mk
index 951cf83ee5f91954af8ded73fac55c0970605d89..e2fa72be94abdcb940b22e4cd24f7d4d1121c2c0 100644 (file)
--- 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.1437 2021/09/25 10:32:30 tom Exp $
+# $Id: dist.mk,v 1.1438 2021/10/02 08:31:49 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 = 20210925
+NCURSES_PATCH = 20211002
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 896a37dc9c298d257141e27b8a0626acb851aea7..6285fb237acf3a2c70be1264a200a512e06d2524 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 6c62295d07afbbe4d0e7eda5a7c328211e54e3f4..aefa17abfa87c840bed0bb75bd4b6a461d092e2b 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index bb222f9143bfda669f735180b8cab8880de11e28..537916a8f6c22fac50a197b558efbf5314604552 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="tput.1.html">tput(1)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 907b12a52004e3bc0ca4fa8b2e166fe68f47452a..6304e60fb0932f1311f38c2fdc6e69edfd372a62 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names  begin  "form_"  for  detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 18573a0d72ff6910fe66a7702dc1a9734e7d8c75..3454a76ea53346baae1570df3bbfc99de2d23047 100644 (file)
 
        https://invisible-island.net/ncurses/tctest.html
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 66c5384494edb20232ae56a5c719182681a455ae..3980b99a2e191714efec74547986089a92085d5e 100644 (file)
@@ -91,7 +91,7 @@
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 590b0cea4f7dafb4de7cedc0daa16486705f161a..64c40f50ed366eb9a6ccf3d207e9f2e410ff0237 100644 (file)
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG> and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 6bfb8675c07e85f509ca503744940566655ccd27..03b8e47c1bdfa73d89ea471ad64fe663cfa2b570 100644 (file)
@@ -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 <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
        The  <STRONG>ncurses</STRONG>  library emulates the curses library of System V Release 4
        UNIX, and XPG4 (X/Open Portability Guide) curses  (also  known  as  XSI
index 12273291f20a7e135280b5176a9d46347594ba86..0fa8141b475a73028ff43f016420013abd6c5fd4 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 0f61e014b25659183b008d4d9e1f2eba26994048..22cf71ecee1d984eafd2984e616480141531880a 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="curs_variables.3x.html">curs_variables(3x)</A></STRONG>,
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index dc5cf413717962cd6049fd2bd71f5f795e284cef..6bb29cd8629d1736d5051a9a076e9c4ff1ed65ff 100644 (file)
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 540e7060f7a684492c2b93e8124af9a0191bf4e6..f4020d0351445f2b1bb9fea172d4b446ad2e12e1 100644 (file)
@@ -62,7 +62,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: terminfo.tail,v 1.106 2021/08/28 19:00:29 tom Exp @
+  * @Id: terminfo.tail,v 1.107 2021/10/02 20:54:06 tom Exp @
   *.in -2
   *.in +2
   *.in -2
        have, by specifying how to perform screen operations, and by specifying
        padding requirements and initialization sequences.
 
-       This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This manual describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 </PRE><H3><a name="h3-Terminfo-Entry-Syntax">Terminfo Entry Syntax</a></H3><PRE>
        outputting <STRONG>rmcup</STRONG>), specify <STRONG>nrrmc</STRONG>.
 
 
+</PRE><H3><a name="h3-Margins">Margins</a></H3><PRE>
+       SVr4  (and  X/Open Curses) list several string capabilities for setting
+       margins.  Two were intended for use with  terminals,  and  another  six
+       were intended for use with printers.
+
+       <STRONG>o</STRONG>   The two terminal capabilities assume that the terminal may have the
+           capability of setting the left and/or right margin at  the  current
+           cursor column position.
+
+       <STRONG>o</STRONG>   The printer capabilities assume that the printer may have two types
+           of capability:
+
+           <STRONG>o</STRONG>   the ability to set a top and/or bottom margin using the current
+               line position, and
+
+           <STRONG>o</STRONG>   parameterized  capabilities  for setting the top, bottom, left,
+               right margins given the number of rows or columns.
+
+       In practice, the categorization into "terminal" and  "printer"  is  not
+       suitable:
+
+       <STRONG>o</STRONG>   The  AT&amp;T  SVr4  terminal  database  uses <STRONG>smgl</STRONG> four times, for AT&amp;T
+           hardware.
+
+           Three of the four are printers.   They  lack  the  ability  to  set
+           left/right margins by specifying the column.
+
+       <STRONG>o</STRONG>   Other  (non-AT&amp;T) terminals may support margins but using different
+           assumptions from AT&amp;T.
+
+           For instance, the DEC VT420 supports left/right margins,  but  only
+           using a column parameter.  As an added complication, the VT420 uses
+           two settings to fully enable left/right margins (left/right  margin
+           mode,  and  origin  mode).   The  former enables the margins, which
+           causes printed text to wrap  within  margins,  but  the  latter  is
+           needed to prevent cursor-addressing outside those margins.
+
+       <STRONG>o</STRONG>   Both  DEC  VT420  left/right  margins are set with a single control
+           sequence.  If either is omitted, the corresponding margin is set to
+           the  left  or  right  edge  of the display (rather than leaving the
+           margin unmodified).
+
+       These are the margin-related capabilities:
+
+                    <STRONG>Name</STRONG>       <STRONG>Description</STRONG>
+                    ----------------------------------------------
+                    smgl       Set left margin at current column
+                    smgr       Set right margin at current column
+                    smgb       Set bottom margin at current line
+                    smgt       Set top margin at current line
+                    smgbp      Set bottom margin at line <EM>N</EM>
+                    smglp      Set left margin at column <EM>N</EM>
+                    smgrp      Set right margin at column <EM>N</EM>
+                    smgtp      Set top margin at line <EM>N</EM>
+
+       When writing an application that uses these  string  capabilities,  the
+       pairs  should be first checked to see if each capability in the pair is
+       set or only one is set:
+
+       <STRONG>o</STRONG>   If both <STRONG>smglp</STRONG> and <STRONG>smgrp</STRONG>  are  set,  each  is  used  with  a  single
+           argument,  <EM>N</EM>,  that  gives  the column number of the left and right
+           margin, respectively.
+
+       <STRONG>o</STRONG>   If both <STRONG>smgtp</STRONG> and <STRONG>smgbp</STRONG> are set, each is used to set  the  top  and
+           bottom margin, respectively:
+
+           <STRONG>o</STRONG>   <STRONG>smgtp</STRONG> is used with a single argument, <EM>N</EM>, the line number of the
+               top margin.
+
+           <STRONG>o</STRONG>   <STRONG>smgbp</STRONG> is used with two arguments, <EM>N</EM> and <EM>M</EM>, that give  the  line
+               number of the bottom margin, the first counting from the top of
+               the page  and  the  second  counting  from  the  bottom.   This
+               accommodates  the two styles of specifying the bottom margin in
+               different manufacturers' printers.
+
+           When designing a terminfo entry for a printer that has  a  settable
+           bottom  margin,  only  the first or second argument should be used,
+           depending on the printer.  When developing an application that uses
+           <STRONG>smgbp</STRONG> to set the bottom margin, both arguments must be given.
+
+       Conversely, when only one capability in the pair is set:
+
+       <STRONG>o</STRONG>   If  only  one  of  <STRONG>smglp</STRONG> and <STRONG>smgrp</STRONG> is set, then it is used with two
+           arguments, the column number of the left and right margins, in that
+           order.
+
+       <STRONG>o</STRONG>   Likewise,  if  only  one of <STRONG>smgtp</STRONG> and <STRONG>smgbp</STRONG> is set, then it is used
+           with two arguments that give the top and bottom  margins,  in  that
+           order, counting from the top of the page.
+
+           When designing a terminfo entry for a printer that requires setting
+           both left and right or top and bottom margins simultaneously,  only
+           one  capability  in  the  pairs  <STRONG>smglp</STRONG> and <STRONG>smgrp</STRONG> or <STRONG>smgtp</STRONG> and <STRONG>smgbp</STRONG>
+           should be defined, leaving the other unset.
+
+       When setting margins, the line- and column-values are zero-based.
+
+       The <STRONG>mgc</STRONG> string capability should  be  defined.   Applications  such  as
+       <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG> rely upon this to reset all margins.
+
+
 </PRE><H3><a name="h3-Area-Clears">Area Clears</a></H3><PRE>
        If  the  terminal can clear from the current position to the end of the
        line, leaving the cursor where it is, this should be given as  <STRONG>el</STRONG>.   If
                <STRONG>tparm</STRONG> <STRONG>parameter</STRONG>      <STRONG>attribute</STRONG>        <STRONG>escape</STRONG> <STRONG>sequence</STRONG>
 
                none                 none             \E[0m
+
                p1                   standout         \E[0;1;7m
                p2                   underline        \E[0;4m
                p3                   reverse          \E[0;7m
          solid square block          ACS_BLOCK      #         0        0x30
          diamond                     ACS_DIAMOND    +         `        0x60
          checker board (stipple)     ACS_CKBOARD    :         a        0x61
-
          degree symbol               ACS_DEGREE     \         f        0x66
          plus/minus                  ACS_PLMINUS    #         g        0x67
          board of squares            ACS_BOARD      #         h        0x68
          tee pointing right          ACS_LTEE       +         t        0x74
          tee pointing left           ACS_RTEE       +         u        0x75
          tee pointing up             ACS_BTEE       +         v        0x76
+
          tee pointing down           ACS_TTEE       +         w        0x77
          vertical line               ACS_VLINE      |         x        0x78
          less-than-or-equal-to       ACS_LEQUAL     &lt;         y        0x79
 <li><a href="#h3-Basic-Capabilities">Basic Capabilities</a></li>
 <li><a href="#h3-Parameterized-Strings">Parameterized Strings</a></li>
 <li><a href="#h3-Cursor-Motions">Cursor Motions</a></li>
+<li><a href="#h3-Margins">Margins</a></li>
 <li><a href="#h3-Area-Clears">Area Clears</a></li>
 <li><a href="#h3-Insert_delete-line-and-vertical-motions">Insert/delete line and vertical motions</a></li>
 <li><a href="#h3-Insert_Delete-Character">Insert/Delete Character</a></li>
index 39f1e664a510447ea1c881d31158787be50e2540..4127b6d038616d07e2a940b730acccaa45bc9f6e 100644 (file)
        <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="toe.1m.html">toe(1m)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="term.5.html">term(5)</A></STRONG>.  <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.  <STRONG><A HREF="user_caps.5.html">user_caps(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 </PRE><H2><a name="h2-AUTHOR">AUTHOR</a></H2><PRE>
index 70f0340b18ab6b2f115c362e69dbc62abf0f9efa..a55bf168b7255848a3c084e2b7f165d27ed3dd71 100644 (file)
        <STRONG><A HREF="captoinfo.1m.html">captoinfo(1m)</A></STRONG>,   <STRONG><A HREF="infocmp.1m.html">infocmp(1m)</A></STRONG>,   <STRONG><A HREF="infotocap.1m.html">infotocap(1m)</A></STRONG>,   <STRONG><A HREF="tic.1m.html">tic(1m)</A></STRONG>,   <STRONG><A HREF="ncurses.3x.html">curses(3x)</A></STRONG>,
        <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 00b0e006803be814fd0d0a28f0439e42113a96d2..4376be4580af386b6c243c8bbc4ce471ec36885b 100644 (file)
@@ -28,7 +28,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: tput.1,v 1.71 2021/09/19 00:34:23 tom Exp @
+  * @Id: tput.1,v 1.72 2021/10/02 21:41:00 tom Exp @
 -->
 <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01//EN">
 <HTML>
            to analyze nonstandard <EM>capname</EM> operands.
 
            Besides  providing  more  reliable operation than AT&amp;T's utility, a
-           portability problem is introduced by  this  analysis.   An  OpenBSD
+           portability problem is introduced  by  this  analysis:  An  OpenBSD
            developer  adapted  the  internal  library function from ncurses to
-           allow <STRONG>tput</STRONG> to interpret multiple  commands  on  a  line.   Portable
+           port NetBSD's  termcap-based  <STRONG>tput</STRONG>  to  terminfo.   That  had  been
+           modified  to  interpret  multiple  commands  on  a  line.  Portable
            applications should not rely upon this feature; ncurses provides it
            to support applications written specifically for OpenBSD.
 
        This  implementation  (unlike  others)  can  accept  both  <EM>termcap</EM>  and
-       <EM>terminfo</EM>  names for the <EM>capname</EM> feature, if <EM>termcap</EM> support is compiled
-       in.  However, the  predefined  <EM>termcap</EM>  and  <EM>terminfo</EM>  names  have  two
+       <EM>terminfo</EM> names for the <EM>capname</EM> feature, if <EM>termcap</EM> support is  compiled
+       in.   However,  the  predefined  <EM>termcap</EM>  and  <EM>terminfo</EM>  names have two
        ambiguities in this case (and the <EM>terminfo</EM> name is assumed):
 
-       <STRONG>o</STRONG>   The  <EM>termcap</EM>  name  <STRONG>dl</STRONG> corresponds to the <EM>terminfo</EM> name <STRONG>dl1</STRONG> (delete
+       <STRONG>o</STRONG>   The <EM>termcap</EM> name <STRONG>dl</STRONG> corresponds to the <EM>terminfo</EM>  name  <STRONG>dl1</STRONG>  (delete
            one line).
-           The <EM>terminfo</EM> name <STRONG>dl</STRONG> corresponds to the <EM>termcap</EM> name <STRONG>DL</STRONG>  (delete  a
+           The  <EM>terminfo</EM>  name <STRONG>dl</STRONG> corresponds to the <EM>termcap</EM> name <STRONG>DL</STRONG> (delete a
            given number of lines).
 
-       <STRONG>o</STRONG>   The  <EM>termcap</EM>  name  <STRONG>ed</STRONG>  corresponds  to the <EM>terminfo</EM> name <STRONG>rmdc</STRONG> (end
+       <STRONG>o</STRONG>   The <EM>termcap</EM> name <STRONG>ed</STRONG> corresponds to  the  <EM>terminfo</EM>  name  <STRONG>rmdc</STRONG>  (end
            delete mode).
-           The <EM>terminfo</EM> name <STRONG>ed</STRONG> corresponds to the <EM>termcap</EM> name <STRONG>cd</STRONG>  (clear  to
+           The  <EM>terminfo</EM>  name <STRONG>ed</STRONG> corresponds to the <EM>termcap</EM> name <STRONG>cd</STRONG> (clear to
            end of screen).
 
-       The  <STRONG>longname</STRONG>  and  <STRONG>-S</STRONG> options, and the parameter-substitution features
-       used in the <STRONG>cup</STRONG> example,  were  not  supported  in  BSD  curses  before
+       The <STRONG>longname</STRONG> and <STRONG>-S</STRONG> options, and  the  parameter-substitution  features
+       used  in  the  <STRONG>cup</STRONG>  example,  were  not  supported in BSD curses before
        4.3reno (1989) or in AT&amp;T/USL curses before SVr4 (1988).
 
-       IEEE   Std   1003.1/The   Open   Group   Base  Specifications  Issue  7
-       (POSIX.1-2008) documents only the operands for <STRONG>clear</STRONG>, <STRONG>init</STRONG>  and  <STRONG>reset</STRONG>.
+       IEEE  Std  1003.1/The  Open  Group    Base   Specifications   Issue   7
+       (POSIX.1-2008)  documents  only the operands for <STRONG>clear</STRONG>, <STRONG>init</STRONG> and <STRONG>reset</STRONG>.
        There are a few interesting observations to make regarding that:
 
-       <STRONG>o</STRONG>   In  this implementation, <STRONG>clear</STRONG> is part of the <EM>capname</EM> support.  The
-           others  (<STRONG>init</STRONG>  and  <STRONG>longname</STRONG>)  do  not   correspond   to   terminal
+       <STRONG>o</STRONG>   In this implementation, <STRONG>clear</STRONG> is part of the <EM>capname</EM> support.   The
+           others   (<STRONG>init</STRONG>   and   <STRONG>longname</STRONG>)  do  not  correspond  to  terminal
            capabilities.
 
        <STRONG>o</STRONG>   Other  implementations  of  <STRONG>tput</STRONG>  on  SVr4-based  systems  such  as
-           Solaris, IRIX64 and HPUX as well as others such as  AIX  and  Tru64
+           Solaris,  IRIX64  and  HPUX as well as others such as AIX and Tru64
            provide support for <EM>capname</EM> operands.
 
        <STRONG>o</STRONG>   A few platforms such as FreeBSD recognize termcap names rather than
            terminfo capability names in their respective <STRONG>tput</STRONG> commands.  Since
-           2010,  NetBSD's  <STRONG>tput</STRONG>  uses  terminfo names.  Before that, it (like
+           2010, NetBSD's <STRONG>tput</STRONG> uses terminfo names.   Before  that,  it  (like
            FreeBSD) recognized termcap names.
 
-           Beginning in 2021, FreeBSD uses the ncurses  <STRONG>tput</STRONG>,  configured  for
+           Beginning  in  2021,  FreeBSD uses the ncurses <STRONG>tput</STRONG>, configured for
            both terminfo (tested first) and termcap (as a fallback).
 
        Because (apparently) <EM>all</EM> of the certified Unix systems support the full
-       set of capability names, the reasoning for documenting only a  few  may
+       set  of  capability names, the reasoning for documenting only a few may
        not be apparent.
 
-       <STRONG>o</STRONG>   X/Open  Curses Issue 7 documents <STRONG>tput</STRONG> differently, with <EM>capname</EM> and
+       <STRONG>o</STRONG>   X/Open Curses Issue 7 documents <STRONG>tput</STRONG> differently, with <EM>capname</EM>  and
            the other features used in this implementation.
 
-       <STRONG>o</STRONG>   That is, there are two standards for <STRONG>tput</STRONG>:  POSIX  (a  subset)  and
-           X/Open  Curses (the full implementation).  POSIX documents a subset
-           to avoid the  complication  of  including  X/Open  Curses  and  the
+       <STRONG>o</STRONG>   That  is,  there  are  two standards for <STRONG>tput</STRONG>: POSIX (a subset) and
+           X/Open Curses (the full implementation).  POSIX documents a  subset
+           to  avoid  the  complication  of  including  X/Open  Curses and the
            terminal capabilities database.
 
-       <STRONG>o</STRONG>   While  it  is  certainly  possible  to write a <STRONG>tput</STRONG> program without
-           using  curses,  none  of  the   systems   which   have   a   curses
-           implementation  provide  a  <STRONG>tput</STRONG> utility which does not provide the
+       <STRONG>o</STRONG>   While it is certainly possible to  write  a  <STRONG>tput</STRONG>  program  without
+           using   curses,   none   of   the   systems  which  have  a  curses
+           implementation provide a <STRONG>tput</STRONG> utility which does  not  provide  the
            <EM>capname</EM> feature.
 
        X/Open  Curses  Issue  7  (2009)  is  the  first  version  to  document
        utilities.  However that part of X/Open Curses does not follow existing
        practice (i.e., Unix features documented in SVID 3):
 
-       <STRONG>o</STRONG>   It assigns exit code 4 to "invalid operand", which may be the  same
-           as  <EM>unknown</EM> <EM>capability</EM>.  For instance, the source code for Solaris'
+       <STRONG>o</STRONG>   It  assigns exit code 4 to "invalid operand", which may be the same
+           as <EM>unknown</EM> <EM>capability</EM>.  For instance, the source code for  Solaris'
            xcurses uses the term "invalid" in this case.
 
-       <STRONG>o</STRONG>   It assigns exit  code  255  to  a  numeric  variable  that  is  not
+       <STRONG>o</STRONG>   It  assigns  exit  code  255  to  a  numeric  variable  that is not
            specified in the terminfo database.  That likely is a documentation
-           error, confusing the <STRONG>-1</STRONG> written  to  the  standard  output  for  an
+           error,  confusing  the  <STRONG>-1</STRONG>  written  to  the standard output for an
            absent or cancelled numeric value versus an (unsigned) exit code.
 
-       The  various  Unix systems (AIX, HPUX, Solaris) use the same exit-codes
+       The various Unix systems (AIX, HPUX, Solaris) use the  same  exit-codes
        as ncurses.
 
        NetBSD curses documents different exit codes which do not correspond to
 </PRE><H2><a name="h2-SEE-ALSO">SEE ALSO</a></H2><PRE>
        <STRONG><A HREF="clear.1.html">clear(1)</A></STRONG>, <STRONG>stty(1)</STRONG>, <STRONG><A HREF="tabs.1.html">tabs(1)</A></STRONG>, <STRONG><A HREF="tset.1.html">tset(1)</A></STRONG>, <STRONG><A HREF="curs_termcap.3x.html">curs_termcap(3x)</A></STRONG>, <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>.
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index ed9dc11ca9caa56a4608e405bbb04f79887e8377..92f13e131f4e259dc8d2cf23b97be17fe10c4957 100644 (file)
        <STRONG>csh(1)</STRONG>,   <STRONG>sh(1)</STRONG>,   <STRONG>stty(1)</STRONG>,   <STRONG><A HREF="curs_terminfo.3x.html">curs_terminfo(3x)</A></STRONG>,  <STRONG>tty(4)</STRONG>,  <STRONG><A HREF="terminfo.5.html">terminfo(5)</A></STRONG>,
        <STRONG>ttys(5)</STRONG>, <STRONG>environ(7)</STRONG>
 
-       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20210925).
+       This describes <STRONG>ncurses</STRONG> version 6.2 (patch 20211002).
 
 
 
index 5c3abd1b99c2f0919a49849a6fa62c2f7aa38699..07217112cab5022264f2ef54178aac7ee544e333 100644 (file)
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: terminfo.tail,v 1.106 2021/08/28 19:00:29 tom Exp $
+.\" $Id: terminfo.tail,v 1.107 2021/10/02 20:54:06 tom Exp $
 .ps +1
 .SS User-Defined Capabilities
 .
@@ -647,6 +647,122 @@ If the \fBsmcup\fP sequence will not restore the screen after an
 \fBrmcup\fP sequence is output (to the state prior to outputting
 \fBrmcup\fP), specify \fBnrrmc\fP.
 .PP
+.SS Margins
+SVr4 (and X/Open Curses)
+list several string capabilities for setting margins.
+Two were intended for use with terminals,
+and another six were intended for use with printers.
+.bP
+The two terminal capabilities assume that the terminal may have
+the capability of setting the left and/or right margin at the current
+cursor column position.
+.bP
+The printer capabilities assume that the printer may have
+two types of capability:
+.RS
+.bP
+the ability to set a top and/or bottom margin using the current
+line position, and
+.bP
+parameterized capabilities for setting the top, bottom, left, right margins
+given the number of rows or columns.
+.RE
+.RE
+.PP
+In practice, the categorization into \*(``terminal\*('' and \*(``printer\*(''
+is not suitable:
+.bP
+The AT&T SVr4 terminal database uses \fBsmgl\fP four times,
+for AT&T hardware.
+.IP
+Three of the four are printers.
+They lack the ability to set left/right margins by specifying the column.
+.bP
+Other (non-AT&T) terminals may support margins
+but using different assumptions from AT&T.
+.IP
+For instance, the DEC VT420 supports left/right margins,
+but only using a column parameter.
+As an added complication, the VT420 uses two settings to fully enable
+left/right margins (left/right margin mode, and origin mode).
+The former enables the margins, which causes printed text
+to wrap within margins, but the latter is needed to prevent
+cursor-addressing outside those margins.
+.bP
+Both DEC VT420 left/right margins are set with a single control sequence.
+If either is omitted, the corresponding margin is set to the left or
+right edge of the display (rather than leaving the margin unmodified).
+.PP
+These are the margin-related capabilities:
+.TS
+center;
+l l
+_ _
+lw8 lw18.
+\fBName        Description\fP
+smgl   Set left margin at current column
+smgr   Set right margin at current column
+smgb   Set bottom margin at current line
+smgt   Set top margin at current line
+smgbp  Set bottom margin at line \fIN\fP
+smglp  Set left margin at column \fIN\fP
+smgrp  Set right margin at column \fIN\fP
+smgtp  Set top margin at line \fIN\fP
+.TE
+.PP
+When writing an application that
+uses these string capabilities,
+the pairs should be first checked to see
+if each capability in the pair is set or only one is set:
+.bP
+If both \fBsmglp\fP and \fBsmgrp\fP are set,
+each is used with a single argument, \fIN\fP,
+that gives the column number of the left and right margin, respectively.
+.bP
+If both \fBsmgtp\fP and \fBsmgbp\fP are set,
+each is used to set the top and bottom margin,
+respectively:
+.RS 4
+.bP
+\fBsmgtp\fP is used with a single argument, \fIN\fP,
+the line number of the top margin.
+.bP
+\fBsmgbp\fP is used with two arguments, \fIN\fP and \fIM\fP,
+that give the line number of the bottom margin,
+the first counting from the top of the
+page and the second counting from the bottom.
+This accommodates the two styles of specifying
+the bottom margin in different manufacturers' printers.
+.RE
+.IP
+When designing a terminfo entry for a
+printer that has a settable bottom margin,
+only the first or second argument should be used, depending on the printer.
+When developing an application that uses \fBsmgbp\fP to set the bottom margin,
+both arguments must be given.
+.PP
+Conversely, when only one capability in the pair is set:
+.bP 
+If only one of \fBsmglp\fP and \fBsmgrp\fP is set,
+then it is used with two arguments,
+the column number of the left and right margins, in that order.
+.bP
+Likewise, if only one of \fBsmgtp\fP and \fBsmgbp\fP is set, then it
+is used with two arguments that give the top and bottom margins,
+in that order, counting from the top of the page.
+.IP
+When designing a terminfo entry for a printer that requires setting both
+left and right or top and bottom margins simultaneously,
+only one capability in the pairs
+\fBsmglp\fP and \fBsmgrp\fP or
+\fBsmgtp\fP and \fBsmgbp\fP should be defined,
+leaving the other unset.
+.PP
+When setting margins, the line- and column-values are zero-based.
+.PP
+The \fBmgc\fP string capability should be defined.
+Applications such as \fBtabs\fP(1) rely upon this to reset all margins.
+.\"
 .SS Area Clears
 .PP
 If the terminal can clear from the current position to the end of the
@@ -662,6 +778,7 @@ if a true
 .B ed
 is not available.)
 .PP
+.\"
 .SS Insert/delete line and vertical motions
 .PP
 If the terminal can open a new blank line before the line where the cursor
index 50a7cd6c8fba956d00b9a1bebb2700603ce03e53..0834e44723846d973a88e1695f4915229326c48f 100644 (file)
@@ -28,7 +28,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: tput.1,v 1.71 2021/09/19 00:34:23 tom Exp $
+.\" $Id: tput.1,v 1.72 2021/10/02 21:41:00 tom Exp $
 .TH @TPUT@ 1 ""
 .ds d @TERMINFO@
 .ds n 1
@@ -518,9 +518,10 @@ the standard \fIcapname\fR operands, and an internal library
 function to analyze nonstandard \fIcapname\fR operands.
 .IP
 Besides providing more reliable operation than AT&T's utility,
-a portability problem is introduced by this analysis.
+a portability problem is introduced by this analysis:
 An OpenBSD developer adapted the internal library function from ncurses
-to allow \fBtput\fP to interpret multiple commands on a line.
+to port NetBSD's termcap-based \fBtput\fP to terminfo.
+That had been modified to interpret multiple commands on a line.
 Portable applications should not rely upon this feature;
 ncurses provides it to support applications written
 specifically for OpenBSD.
index 26e473b4bf8fa50646661d52c480571a9fa0c8a1..9dc08557c6dff52f75d278cadc47f61805ced0ea 100755 (executable)
@@ -2,7 +2,7 @@
 #
 # MKlib_gen.sh -- generate sources from curses.h macro definitions
 #
-# ($Id: MKlib_gen.sh,v 1.70 2021/09/24 19:23:20 tom Exp $)
+# ($Id: MKlib_gen.sh,v 1.71 2021/09/26 22:08:53 tom Exp $)
 #
 ##############################################################################
 # Copyright 2018-2020,2021 Thomas E. Dickey                                  #
@@ -470,9 +470,9 @@ END         {
                                if ( value !~ /P_POUNDC/ ) {
                                        gsub(/[ \t]+/," ",value);
                                        sub(/^[0-9a-zA-Z_]+ /,"",value);
-                                       sub(/^\* /,"",value);
-                                       gsub("struct [0-9a-zA-Z_]+ \*","",value);
-                                       gsub(/[0-9a-zA-Z_]+ \* /,"",value);
+                                       sub(/^[*][ \t]*/,"",value);
+                                       gsub("struct[ \t]*[0-9a-zA-Z_]+[ \t]*[*]","",value);
+                                       gsub(/[0-9a-zA-Z_]+[ \t]*[*][ \t]*/,"",value);
                                        gsub(/ (const) /," ",value);
                                        gsub(/ (int|short|attr_t|chtype|wchar_t|NCURSES_BOOL|NCURSES_OUTC|NCURSES_OUTC_sp|va_list) /," ",value);
                                        gsub(/ void /,"",value);
index e4276784f8fed6d5ffd25510c19ae4fd9cfd7f1c..e4dc79b54111b0538597a81030e5bbb7373d0bfd 100644 (file)
@@ -49,7 +49,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_color.c,v 1.147 2021/05/08 15:11:48 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.148 2021/10/02 22:55:48 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define CanChange      InfoOf(SP_PARM).canchange
@@ -831,7 +831,6 @@ static int
 _nc_color_content(SCREEN *sp, int color, int *r, int *g, int *b)
 {
     int result = ERR;
-    int maxcolors;
 
     T((T_CALLED("color_content(%p,%d,%p,%p,%p)"),
        (void *) sp,
@@ -841,7 +840,7 @@ _nc_color_content(SCREEN *sp, int color, int *r, int *g, int *b)
        (void *) b));
 
     if (sp != 0) {
-       maxcolors = MaxColors;
+       int maxcolors = MaxColors;
 
        if (color >= 0 && OkColorHi(color) && sp->_coloron) {
            int c_r, c_g, c_b;
index 1868c009660c37751f3c50153a1b7fead64e5f41..3fff2e83c4df473cdc6e92ba888409ec08772b4d 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018,2020 Thomas E. Dickey                                     *
+ * Copyright 2018-2020,2021 Thomas E. Dickey                                *
  * Copyright 1998-2012,2013 Free Software Foundation, Inc.                  *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -34,7 +34,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: safe_sprintf.c,v 1.33 2020/02/02 23:34:34 tom Exp $")
+MODULE_ID("$Id: safe_sprintf.c,v 1.35 2021/10/03 00:25:09 tom Exp $")
 
 #if USE_SAFE_SPRINTF
 
@@ -223,9 +223,9 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
                                    const char *fmt,
                                    va_list ap)
 {
-    char *result = 0;
+    char *result = NULL;
 
-    if (SP_PARM != 0 && fmt != 0) {
+    if (SP_PARM != NULL && fmt != NULL) {
 #if USE_SAFE_SPRINTF
        va_list ap2;
        int len;
@@ -238,7 +238,7 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
            my_length = (size_t) (2 * (len + 1));
            my_buffer = typeRealloc(char, my_length, my_buffer);
        }
-       if (my_buffer != 0) {
+       if (my_buffer != NULL) {
            *my_buffer = '\0';
            if (len >= 0) {
                vsprintf(my_buffer, fmt, ap);
@@ -255,21 +255,30 @@ NCURSES_SP_NAME(_nc_printf_string) (NCURSES_SP_DCLx
            if (screen_columns(SP_PARM) > MyCols)
                MyCols = screen_columns(SP_PARM);
            my_length = (size_t) (MyRows * (MyCols + 1)) + 1;
+           if (my_length < 80)
+               my_length = 80;
            my_buffer = typeRealloc(char, my_length, my_buffer);
        }
 
-       if (my_buffer != 0) {
+       if (my_buffer != NULL) {
 # if HAVE_VSNPRINTF
-           vsnprintf(my_buffer, my_length, fmt, ap);   /* SUSv2, 1997 */
+           /* SUSv2, 1997 */
+           int used;
+           while ((used = vsnprintf(my_buffer, my_length, fmt, ap))
+                  >= (int) my_length) {
+               my_length = (size_t) ((3 * used) / 2);
+               my_buffer = typeRealloc(char, my_length, my_buffer);
+           }
 # else
-           vsprintf(my_buffer, fmt, ap);       /* ISO/ANSI C, 1989 */
+           /* ISO/ANSI C, 1989 */
+           vsprintf(my_buffer, fmt, ap);
 # endif
            result = my_buffer;
        }
 #endif
-    } else if (my_buffer != 0) {       /* see _nc_freeall() */
+    } else if (my_buffer != NULL) {    /* see _nc_freeall() */
        free(my_buffer);
-       my_buffer = 0;
+       my_buffer = NULL;
        my_length = 0;
     }
     return result;
index 85380ac33e212ed210dcb7080e2d6b570cb08c04..ce7a986bd9edb50e507c88f635985187f5144ffc 100644 (file)
@@ -27,7 +27,7 @@
  ****************************************************************************/
 
 /*
- * $Id: term.priv.h,v 1.5 2021/09/24 16:42:04 tom Exp $
+ * $Id: term.priv.h,v 1.6 2021/09/26 20:43:08 tom Exp $
  *
  *     term.priv.h
  *
@@ -55,6 +55,12 @@ extern "C" {
 #include <time.h>              /* time_t */
 #include <term.h>              /* time_t */
 
+#ifdef USE_PTHREADS
+#if USE_REENTRANT
+#include <pthread.h>
+#endif
+#endif
+
 /*
  * State of tparm().
  */
index 42f5224a5998b9d2a6e7087265554dba0ab02315..d8bc3611644b8ecca4199477fc35f7e50d175ec8 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210925) unstable; urgency=low
+ncurses6 (6.2+20211002) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 24 Sep 2021 15:17:49 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 26 Sep 2021 16:21:29 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 42f5224a5998b9d2a6e7087265554dba0ab02315..d8bc3611644b8ecca4199477fc35f7e50d175ec8 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210925) unstable; urgency=low
+ncurses6 (6.2+20211002) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 24 Sep 2021 15:17:49 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 26 Sep 2021 16:21:29 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index b6df649bbe7e83df58ecf18608832afcd29d5b53..ebfe4387ae1da7263d4e57c1cc6bfe9b8a810551 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20210925) unstable; urgency=low
+ncurses6 (6.2+20211002) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 24 Sep 2021 15:17:49 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 26 Sep 2021 16:21:29 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 043cd554a59c61ae1303fa8b78b1c3dd234d9146..e4c2fb7e578718ce32e422a8fe5c82924295bbb7 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.479 2021/09/25 10:32:30 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.480 2021/10/02 08:31:49 tom Exp $\r
 \r
 ; TODO add examples\r
 ; TODO bump ABI to 6\r
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"\r
 !define VERSION_MINOR "2"\r
 !define VERSION_YYYY  "2021"\r
-!define VERSION_MMDD  "0925"\r
+!define VERSION_MMDD  "1002"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index d771d4b33f2e6216b1ca00a025ac23a693922d88..be32da313bea4811e008c6f438c01f0da7f15827 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20210925
+Release: 20211002
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index b6755bfd56d6f57f027677c787bc6bcf163e497e..3d8ec810650e6636ac8fd8b950cd51af9186ca49 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20210925
+Release: 20211002
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index dd527d26796fbd2a7980cc1bf843b63901133cc6..6157e3cbcde40fc309cc76a099609caffbdea742 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20210925
+Release: 20211002
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index e740fa667921e12fee6eab7fd20fb0d13ddd2159..eff3af729e6090c75ac0737fb139aa482c80d89a 100644 (file)
@@ -53,7 +53,7 @@
 #include <sys/ptem.h>
 #endif
 
-MODULE_ID("$Id: reset_cmd.c,v 1.27 2021/09/04 10:29:59 tom Exp $")
+MODULE_ID("$Id: reset_cmd.c,v 1.28 2021/10/02 18:08:44 tom Exp $")
 
 /*
  * SCO defines TIOCGSIZE and the corresponding struct.  Other systems (SunOS,
@@ -193,7 +193,7 @@ out_char(int c)
  * a child program dies in raw mode.
  */
 void
-reset_tty_settings(int fd, TTY * tty_settings)
+reset_tty_settings(int fd, TTY * tty_settings, int noset)
 {
     GET_TTY(fd, tty_settings);
 
@@ -329,7 +329,9 @@ reset_tty_settings(int fd, TTY * tty_settings)
        );
 #endif
 
-    SET_TTY(fd, tty_settings);
+    if (!noset) {
+       SET_TTY(fd, tty_settings);
+    }
 }
 
 /*
index 7d457154996f7d4c4eda9c6a7cf597a9413640f4..91a637c7e7b3a603f09a98c368a6cc97f4c67953 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2020 Thomas E. Dickey                                          *
+ * Copyright 2020,2021 Thomas E. Dickey                                     *
  * Copyright 2016 Free Software Foundation, Inc.                            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
@@ -32,7 +32,7 @@
  ****************************************************************************/
 
 /*
- * $Id: reset_cmd.h,v 1.8 2020/02/02 23:34:34 tom Exp $
+ * $Id: reset_cmd.h,v 1.9 2021/10/02 20:58:58 tom Exp $
  *
  * Utility functions for resetting terminal.
  */
@@ -51,7 +51,7 @@ extern bool send_init_strings(int /* fd */, TTY * /* old_settings */);
 extern void print_tty_chars(TTY * /* old_settings */, TTY * /* new_settings */);
 extern void reset_flush(void);
 extern void reset_start(FILE * /* fp */, bool /* is_reset */, bool /* is_init */ );
-extern void reset_tty_settings(int /* fd */, TTY * /* tty_settings */);
+extern void reset_tty_settings(int /* fd */, TTY * /* tty_settings */, int /* noset */);
 extern void set_control_chars(TTY * /* tty_settings */, int /* erase */, int /* intr */, int /* kill */);
 extern void set_conversions(TTY * /* tty_settings */);
 
index a6281b32bbc11233a5cd440495e925db5beb3c59..672e51ed81185f234a794d1456cd545bb058c27e 100644 (file)
@@ -49,7 +49,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.302 2021/09/04 10:29:59 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.305 2021/10/02 11:13:50 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -1338,7 +1338,7 @@ check_ansi_cursor(char *list[4])
            if (j != k
                && !strcmp(list[j], list[k])) {
                char *value = _nc_tic_expand(list[k], TRUE, 0);
-               _nc_warning("repeated cursor control %s\n", value);
+               _nc_warning("repeated cursor control %s", value);
                repeated = TRUE;
            }
        }
@@ -1367,19 +1367,19 @@ check_ansi_cursor(char *list[4])
                    continue;
                if (memcmp(list[j], up, prefix)) {
                    char *value = _nc_tic_expand(list[j], TRUE, 0);
-                   _nc_warning("inconsistent prefix for %s\n", value);
+                   _nc_warning("inconsistent prefix for %s", value);
                    continue;
                }
                if (strlen(list[j]) < suffix) {
                    char *value = _nc_tic_expand(list[j], TRUE, 0);
-                   _nc_warning("inconsistent length for %s, expected %d\n",
+                   _nc_warning("inconsistent length for %s, expected %d",
                                value, (int) suffix + 1);
                    continue;
                }
                want = "BADC"[j];
                if (list[j][suffix] != want) {
                    char *value = _nc_tic_expand(list[j], TRUE, 0);
-                   _nc_warning("inconsistent suffix for %s, expected %c, have %c\n",
+                   _nc_warning("inconsistent suffix for %s, expected %c, have %c",
                                value, want, list[j][suffix]);
                }
            }
@@ -2085,10 +2085,13 @@ check_params(TERMTYPE2 *tp, const char *name, const char *value, int extended)
            for (n = 0; n < limit; ++n) {
                _nc_reset_tparm(NULL);
                (void) TPARM_9(value, n, n, n, n, n, n, n, n, n);
-               if (_nc_tparm_err)
+               if (_nc_tparm_err) {
                    _nc_warning("problem%s in tparm(%s, %d, ...)",
                                (_nc_tparm_err == 1) ? "" : "s",
                                name, n);
+                   if (debug_level < 2)
+                       break;
+               }
            }
        }
     }
index 60a76a2223a8f03a0ffb95372556051d92692b20..32f2ae4c48042690aeac79d3a40031c27585cc6a 100644 (file)
@@ -45,7 +45,7 @@
 #include <hashed_db.h>
 #endif
 
-MODULE_ID("$Id: toe.c,v 1.83 2021/09/21 20:07:51 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.84 2021/09/28 08:27:29 tom Exp $")
 
 #define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
 
@@ -330,6 +330,26 @@ sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp)
 }
 
 #if NCURSES_USE_TERMCAP
+/*
+ * Check if the buffer contents are printable ASCII, ensuring that we do not
+ * accidentally pick up incompatible binary content from a hashed database.
+ */
+static bool
+is_termcap(char *buffer)
+{
+    bool result = TRUE;
+    while (*buffer != '\0') {
+       int ch = UChar(*buffer++);
+       if (ch == '\t')
+           continue;
+       if (ch < ' ' || ch > '~') {
+           result = FALSE;
+           break;
+       }
+    }
+    return result;
+}
+
 static void
 show_termcap(int db_index, int db_limit, char *buffer, DescHook hook)
 {
@@ -518,11 +538,13 @@ typelist(int eargc, char *eargv[],
            db_array[1] = 0;
 
            if (cgetfirst(&buffer, db_array) > 0) {
-               show_termcap(i, eargc, buffer, hook);
-               free(buffer);
-               while (cgetnext(&buffer, db_array) > 0) {
+               if (is_termcap(buffer)) {
                    show_termcap(i, eargc, buffer, hook);
                    free(buffer);
+                   while (cgetnext(&buffer, db_array) > 0) {
+                       show_termcap(i, eargc, buffer, hook);
+                       free(buffer);
+                   }
                }
                cgetclose();
                continue;
@@ -539,6 +561,8 @@ typelist(int eargc, char *eargv[],
 
            if ((fp = safe_fopen(eargv[i], "r")) != 0) {
                while (fgets(buffer, sizeof(buffer), fp) != 0) {
+                   if (!is_termcap(buffer))
+                       break;
                    if (*buffer == '#')
                        continue;
                    if (isspace(*buffer))
index ccc2f56d28c460473767b9e72f7dc0f18cbb5e49..8ac478e667d6e3367e205048473b11d1588dfc5b 100644 (file)
 #include <transform.h>
 #include <tty_settings.h>
 
-MODULE_ID("$Id: tput.c,v 1.94 2021/09/19 00:06:44 tom Exp $")
+MODULE_ID("$Id: tput.c,v 1.97 2021/10/02 18:09:23 tom Exp $")
 
 #define PUTS(s)                fputs(s, stdout)
 
 const char *_nc_progname = "tput";
 
-static char *prg_name;
 static bool is_init = FALSE;
 static bool is_reset = FALSE;
 static bool is_clear = FALSE;
@@ -64,7 +63,7 @@ quit(int status, const char *fmt, ...)
     va_list argp;
 
     va_start(argp, fmt);
-    fprintf(stderr, "%s: ", prg_name);
+    fprintf(stderr, "%s: ", _nc_progname);
     vfprintf(stderr, fmt, argp);
     fprintf(stderr, "\n");
     va_end(argp);
@@ -72,7 +71,7 @@ quit(int status, const char *fmt, ...)
 }
 
 static GCC_NORETURN void
-usage(void)
+usage(const char *optstring)
 {
 #define KEEP(s) s "\n"
     static const char msg[] =
@@ -91,8 +90,21 @@ usage(void)
        KEEP("  capname     unlike clear/init/reset, print value for capability \"capname\"")
     };
 #undef KEEP
-    (void) fprintf(stderr, "Usage: %s [options] [command]\n", prg_name);
-    fputs(msg, stderr);
+    (void) fprintf(stderr, "Usage: %s [options] [command]\n", _nc_progname);
+    if (optstring != NULL) {
+       const char *s = msg;
+       while (*s != '\0') {
+           fputc(UChar(*s), stderr);
+           if (!strncmp(s, "  -", 3)) {
+               if (strchr(optstring, s[3]) == NULL)
+                   s = strchr(s, '\n') + 1;
+           } else if (!strncmp(s, "\n\nC", 3))
+               break;
+           ++s;
+       }
+    } else {
+       fputs(msg, stderr);
+    }
     ExitProgram(ErrUsage);
 }
 
@@ -156,7 +168,7 @@ tput_cmd(int fd, TTY * settings, bool opt_x, int argc, char **argv, int *used)
 
        if (is_reset) {
            reset_start(stdout, TRUE, FALSE);
-           reset_tty_settings(fd, settings);
+           reset_tty_settings(fd, settings, FALSE);
        } else {
            reset_start(stdout, FALSE, TRUE);
        }
@@ -329,11 +341,12 @@ main(int argc, char **argv)
     bool is_alias;
     bool need_tty;
 
-    prg_name = check_aliases(_nc_rootname(argv[0]), TRUE);
+    _nc_progname = check_aliases(_nc_rootname(argv[0]), TRUE);
+    is_alias = (is_clear || is_reset || is_init);
 
     term = getenv("TERM");
 
-    while ((c = getopt(argc, argv, "ST:Vx")) != -1) {
+    while ((c = getopt(argc, argv, is_alias ? "T:Vx" : "ST:Vx")) != -1) {
        switch (c) {
        case 'S':
            cmdline = FALSE;
@@ -350,12 +363,11 @@ main(int argc, char **argv)
            opt_x = TRUE;
            break;
        default:
-           usage();
+           usage(is_alias ? "TVx" : NULL);
            /* NOTREACHED */
        }
     }
 
-    is_alias = (is_clear || is_reset || is_init);
     need_tty = ((is_reset || is_init) ||
                (optind < argc &&
                 (!strcmp(argv[optind], "reset") ||
@@ -369,7 +381,7 @@ main(int argc, char **argv)
            argc -= optind;
            argv += optind;
        }
-       argv[0] = prg_name;
+       argv[0] = strdup(_nc_progname);
     } else {
        argc -= optind;
        argv += optind;
@@ -386,7 +398,7 @@ main(int argc, char **argv)
     if (cmdline) {
        int code = 0;
        if ((argc <= 0) && !is_alias)
-           usage();
+           usage(NULL);
        while (argc > 0) {
            code = tput_cmd(fd, &tty_settings, opt_x, argc, argv, &used);
            if (code != 0)
index 7fd916346aee2346e6291579358d1395d0814615..62611b3d40dbfed89695232105a0a1e461b9a46f 100644 (file)
@@ -98,7 +98,7 @@
 char *ttyname(int fd);
 #endif
 
-MODULE_ID("$Id: tset.c,v 1.128 2021/04/03 23:03:48 tom Exp $")
+MODULE_ID("$Id: tset.c,v 1.130 2021/10/02 18:08:09 tom Exp $")
 
 #ifndef environ
 extern char **environ;
@@ -775,6 +775,7 @@ main(int argc, char **argv)
     bool opt_w = FALSE;                /* set window-size */
     TTY mode, oldmode;
 
+    _nc_progname = _nc_rootname(*argv);
     obsolete(argv);
     noinit = noset = quiet = Sflag = sflag = showterm = 0;
     while ((ch = getopt(argc, argv, "a:cd:e:Ii:k:m:p:qQrSsVw")) != -1) {
@@ -833,7 +834,6 @@ main(int argc, char **argv)
        }
     }
 
-    _nc_progname = _nc_rootname(*argv);
     argc -= optind;
     argv += optind;
 
@@ -855,7 +855,7 @@ main(int argc, char **argv)
 
     if (same_program(_nc_progname, PROG_RESET)) {
        reset_start(stderr, TRUE, FALSE);
-       reset_tty_settings(my_fd, &mode);
+       reset_tty_settings(my_fd, &mode, noset);
     } else {
        reset_start(stderr, FALSE, TRUE);
     }