]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.1 - patch 20190511
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 11 May 2019 22:31:51 +0000 (22:31 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 11 May 2019 22:31:51 +0000 (22:31 +0000)
+ fix a spurious blank line seen with "infocmp -1fx xterm+x11mouse"
+ add checks in repair_subwindows() to keep the current position and
  scroll-margins inside the resized subwindow.
+ add a limit check in newline_forces_scroll() for the case where the
  row is inside scroll-margins, but not at the end (report by Toshio
  Kuratomi, cf: 20170729).
+ corrected a warning message in tic for extended capabilities versus
  number of parameters.

16 files changed:
NEWS
VERSION
dist.mk
ncurses/Makefile.in
ncurses/base/lib_addch.c
ncurses/base/wresize.c
ncurses/build.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/dump_entry.c
progs/tic.c

diff --git a/NEWS b/NEWS
index b461acde493d48a8249b223289782fd6aadb35db..50bc9c481720d0b1040b545de0f44a85ef5d9271 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.3314 2019/05/04 20:55:23 tom Exp $
+-- $Id: NEWS,v 1.3317 2019/05/11 21:20:49 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,16 @@ 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.
 
+20190511
+       + fix a spurious blank line seen with "infocmp -1fx xterm+x11mouse"
+       + add checks in repair_subwindows() to keep the current position and
+         scroll-margins inside the resized subwindow.
+       + add a limit check in newline_forces_scroll() for the case where the
+         row is inside scroll-margins, but not at the end (report by Toshio
+         Kuratomi, cf: 20170729).
+       + corrected a warning message in tic for extended capabilities versus
+         number of parameters.
+
 20190504
        + improve workaround for Solaris wcwidth versus line-drawing characters
          (report by Pavel Stehule).
diff --git a/VERSION b/VERSION
index b1e46f6afe8e2cbbf9d3b2bdf8af55e3333897cd..b529c225eb6e1eea979b966ab519114ce6e51f74 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.1     20190504
+5:0:10 6.1     20190511
diff --git a/dist.mk b/dist.mk
index f247558dc8dd11c92b5c5671108db4e11e809d7a..f6e7d5c321d616acf14867e630a38a1c42c50051 100644 (file)
--- 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.1281 2019/05/04 10:02:52 tom Exp $
+# $Id: dist.mk,v 1.1282 2019/05/10 20:55:16 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 = 20190504
+NCURSES_PATCH = 20190511
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 5e528243500f66d9ae6bc64f8d26c4017eb75780..a81500ed0bf53091b398ec2db0f09ca735aef559 100644 (file)
@@ -1,4 +1,4 @@
-# $Id: Makefile.in,v 1.160 2019/03/09 23:39:14 tom Exp $
+# $Id: Makefile.in,v 1.161 2019/05/11 14:15:21 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2018,2019 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -233,11 +233,13 @@ keys.list :       $(tinfo)/MKkeys_list.sh
        AWK=$(AWK) $(SHELL) $(tinfo)/MKkeys_list.sh $(CAPLIST) | LC_ALL=C sort >$@
 
 make_keys$(BUILD_EXEEXT) : \
+               build.priv.h \
                $(tinfo)/make_keys.c \
                names.c
        $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_keys.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
 
 make_hash$(BUILD_EXEEXT) : \
+               build.priv.h \
                $(tinfo)/make_hash.c \
                ../include/hashsize.h
        $(BUILD_CC) -o $@ $(BUILD_CPPFLAGS) $(BUILD_CCFLAGS) $(tinfo)/make_hash.c $(BUILD_LDFLAGS) $(BUILD_LIBS)
index 7c70fa63c062c29b913f532ac7d6994cc44451cf..fdb26415b205c32ac0c91e21c86ab1c2f294a40a 100644 (file)
@@ -36,7 +36,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_addch.c,v 1.132 2019/05/04 20:46:24 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.133 2019/05/11 19:51:02 tom Exp $")
 
 static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
 
@@ -125,7 +125,7 @@ newline_forces_scroll(WINDOW *win, NCURSES_SIZE_T *ypos)
        if (*ypos == win->_regbottom) {
            *ypos = win->_regbottom;
            result = TRUE;
-       } else {
+       } else if (*ypos < win->_maxy) {
            *ypos = (NCURSES_SIZE_T) (*ypos + 1);
        }
     } else if (*ypos < win->_maxy) {
@@ -343,6 +343,7 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
                    return ERR;
                x = win->_curx;
                y = win->_cury;
+               CHECK_POSITION(win, x, y);
                line = win->_line + y;
            }
            /*
@@ -447,6 +448,7 @@ waddch_nosync(WINDOW *win, const NCURSES_CH_T ch)
      */
     x = win->_curx;
     y = win->_cury;
+    CHECK_POSITION(win, x, y);
 
     switch (t) {
     case '\t':
index bc6b5732ea41fe05aa46ed575c2db9af8d6b7389..ee0594034d3759164c7fe183c9d946a9a652133c 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2019 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: wresize.c,v 1.35 2011/05/21 18:55:07 tom Exp $")
+MODULE_ID("$Id: wresize.c,v 1.38 2019/05/11 20:15:15 tom Exp $")
 
 static int
 cleanup_lines(struct ldat *data, int length)
 {
     while (--length >= 0)
-       free(data[length].text);
+       FreeAndNull(data[length].text);
     free(data);
     return ERR;
 }
@@ -65,15 +65,29 @@ repair_subwindows(WINDOW *cmp)
 
        if (tst->_parent == cmp) {
 
-           if (tst->_pary > cmp->_maxy)
-               tst->_pary = cmp->_maxy;
-           if (tst->_parx > cmp->_maxx)
-               tst->_parx = cmp->_maxx;
+#define REPAIR1(field, limit) \
+           if (tst->field > cmp->limit) \
+               tst->field = cmp->limit
 
-           if (tst->_maxy + tst->_pary > cmp->_maxy)
-               tst->_maxy = (NCURSES_SIZE_T) (cmp->_maxy - tst->_pary);
-           if (tst->_maxx + tst->_parx > cmp->_maxx)
-               tst->_maxx = (NCURSES_SIZE_T) (cmp->_maxx - tst->_parx);
+           REPAIR1(_pary, _maxy);
+           REPAIR1(_parx, _maxx);
+
+#define REPAIR2(field, limit) \
+           if (tst->limit + tst->field > cmp->limit) \
+               tst->limit = (NCURSES_SIZE_T) (cmp->limit - tst->field)
+
+           REPAIR2(_pary, _maxy);
+           REPAIR2(_parx, _maxx);
+
+#define REPAIR3(field, limit) \
+           if (tst->field > tst->limit) \
+               tst->field = tst->limit
+
+           REPAIR3(_cury, _maxy);
+           REPAIR3(_curx, _maxx);
+
+           REPAIR3(_regtop, _maxy);
+           REPAIR3(_regbottom, _maxy);
 
            for (row = 0; row <= tst->_maxy; ++row) {
                tst->_line[row].text = &pline[tst->_pary + row].text[tst->_parx];
@@ -204,16 +218,16 @@ wresize(WINDOW *win, int ToLines, int ToCols)
     if (!(win->_flags & _SUBWIN)) {
        if (ToCols == size_x) {
            for (row = ToLines + 1; row <= size_y; row++) {
-               free(win->_line[row].text);
+               FreeAndNull(win->_line[row].text);
            }
        } else {
            for (row = 0; row <= size_y; row++) {
-               free(win->_line[row].text);
+               FreeAndNull(win->_line[row].text);
            }
        }
     }
 
-    free(win->_line);
+    FreeAndNull(win->_line);
     win->_line = new_lines;
 
     /*
index 096a4431bc1e9076738c655daa2b693bc67caa5b..84e4c52a220a314fc9d85bab4fabeca410f35e7e 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2010,2012 Free Software Foundation, Inc.                   *
+ * Copyright (c) 2010-2012,2019 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -31,7 +31,7 @@
  ****************************************************************************/
 
 /*
- * $Id: build.priv.h,v 1.9 2012/02/22 22:17:02 tom Exp $
+ * $Id: build.priv.h,v 1.10 2019/05/11 14:14:00 tom Exp $
  *
  *     build.priv.h
  *
@@ -77,7 +77,7 @@ extern "C" {
 #define EXIT_FAILURE 1
 #endif
 
-#define FreeAndNull(p)   free(p); p = 0
+#define FreeAndNull(p)   do { free(p); p = 0; } while (0)
 #define UChar(c)         ((unsigned char)(c))
 #define SIZEOF(v)        (sizeof(v) / sizeof(v[0]))
 
index bce2e0f5afb496aa72d6516be92ed5f48f3d142d..dcc0002d2a9af4e989f0e2abc15be1c1239e7a60 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190504) unstable; urgency=low
+ncurses6 (6.1+20190511) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 04 May 2019 06:02:52 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 10 May 2019 16:55:16 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index bce2e0f5afb496aa72d6516be92ed5f48f3d142d..dcc0002d2a9af4e989f0e2abc15be1c1239e7a60 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190504) unstable; urgency=low
+ncurses6 (6.1+20190511) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 04 May 2019 06:02:52 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 10 May 2019 16:55:16 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index e5f12789a4c5b1097c9c6b8dd6b5f4a4621376fa..bae1d1b62d791ac3c6455f56e3a7801ba7726e0c 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.1+20190504) unstable; urgency=low
+ncurses6 (6.1+20190511) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 04 May 2019 06:02:52 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 10 May 2019 16:55:16 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 2c2485940e60774922e942dea753d65792609be2..a191ee9aa1f67121d7bafb5e5f30a3c57d613e18 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.327 2019/05/04 10:02:52 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.328 2019/05/10 20:55:16 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 "1"\r
 !define VERSION_YYYY  "2019"\r
-!define VERSION_MMDD  "0504"\r
+!define VERSION_MMDD  "0511"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index bf86325da4262d245a2a6fad11e098734ebc2ba9..8751d6366500cca8d5a6983c39a7fcce68690eec 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.1
-Release: 20190504
+Release: 20190511
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 79510b6158c11ad349d8d94c30918cccbb9b934c..034c4c96f1f1bc06e6598db2d2c97fad8ba65138 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.1
-Release: 20190504
+Release: 20190511
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 77bb65f06419a7c568fdbfd3dc00082125f1f7c4..49ee05a62d99b529a6d97a5c1d4bfa8cd180d0df 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.1
-Release: 20190504
+Release: 20190511
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 66b250b9d31dc6c0e1a9be980046b26802725d79..d0e420ecfb453c6410d2d1f67ebbd33a9a36f5a4 100644 (file)
@@ -39,7 +39,7 @@
 #include "termsort.c"          /* this C file is generated */
 #include <parametrized.h>      /* so is this */
 
-MODULE_ID("$Id: dump_entry.c,v 1.172 2019/04/20 18:54:48 tom Exp $")
+MODULE_ID("$Id: dump_entry.c,v 1.173 2019/05/11 21:02:24 tom Exp $")
 
 #define DISCARD(string) string = ABSENT_STRING
 #define PRINTF (void) printf
@@ -718,6 +718,33 @@ indent_DYN(DYNBUF * buffer, int level)
        strncpy_DYN(buffer, "\t", (size_t) 1);
 }
 
+/*
+ * Check if the current line which was begun consists only of a tab and the
+ * given leading text.
+ */
+static bool
+leading_DYN(DYNBUF * buffer, const char *leading)
+{
+    bool result = FALSE;
+    size_t need = strlen(leading);
+    if (buffer->used > need) {
+       need = buffer->used - need;
+       if (!strcmp(buffer->text + need, leading)) {
+           result = TRUE;
+           while (--need != 0) {
+               if (buffer->text[need] == '\n') {
+                   break;
+               }
+               if (buffer->text[need] != '\t') {
+                   result = FALSE;
+                   break;
+               }
+           }
+       }
+    }
+    return result;
+}
+
 bool
 has_params(const char *src)
 {
@@ -821,7 +848,7 @@ fmt_complex(TERMTYPE2 *tterm, const char *capability, char *src, int level)
            }
            break;
        case 'p':
-           if (percent && params) {
+           if (percent && params && !leading_DYN(&tmpbuf, "%")) {
                tmpbuf.text[tmpbuf.used - 1] = '\n';
                indent_DYN(&tmpbuf, level + 1);
                strncpy_DYN(&tmpbuf, "%", (size_t) 1);
index e0dab0706e98b09862d6e62d1f0cab4cd411bb44..1d4034622c335b51b59b41e79313558636bf27f2 100644 (file)
@@ -48,7 +48,7 @@
 #include <parametrized.h>
 #include <transform.h>
 
-MODULE_ID("$Id: tic.c,v 1.275 2019/05/04 14:41:06 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.276 2019/05/10 21:00:25 tom Exp $")
 
 #define STDIN_NAME "<stdin>"
 
@@ -1939,7 +1939,7 @@ check_params(TERMTYPE2 *tp, const char *name, char *value, int extended)
 #if NCURSES_XNAMES
     if (extended) {
        int check = is_user_capability(name);
-       if (check != actual) {
+       if (check != actual && (check >= 0 && actual >= 0)) {
            _nc_warning("extended %s capability has %d parameters, expected %d",
                        name, actual, check);
        } else if (debug_level > 1) {