]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 6.2 - patch 20211018
authorThomas E. Dickey <dickey@invisible-island.net>
Tue, 19 Oct 2021 00:28:18 +0000 (00:28 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Tue, 19 Oct 2021 00:28:18 +0000 (00:28 +0000)
+ check for screen size-change in scr_init() and scr_restore(), in case
  a screen dump does not match the current screen dimensions (report by
  Frank Tkalcevic).

NEWS
VERSION
dist.mk
ncurses/base/lib_screen.c
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

diff --git a/NEWS b/NEWS
index 92aceb0028ba3cd0b06876c13fc921720c62e85f..13e67f39974b17bd6e3ba82ea57a544aab775eae 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.3729 2021/10/17 15:11:55 tom Exp $
+-- $Id: NEWS,v 1.3730 2021/10/18 22:51:28 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -46,6 +46,11 @@ 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.
 
+20211018
+       + check for screen size-change in scr_init() and scr_restore(), in case
+         a screen dump does not match the current screen dimensions (report by
+         Frank Tkalcevic).
+
 20211017
        + amend change for pkg-config to account for "none" being returned in
          the libdir-path result rather than "no" (report by Gabriele Balducci).
diff --git a/VERSION b/VERSION
index 477411b6c7e9da97132ca27e2e44be1979358dc5..ea4879777cde224a3c3c14b4194e01f31198b14e 100644 (file)
--- a/VERSION
+++ b/VERSION
@@ -1 +1 @@
-5:0:10 6.2     20211017
+5:0:10 6.2     20211018
diff --git a/dist.mk b/dist.mk
index c521e1455c033b9aeca327675bdce5ac1b1a12f8..40f835dff925b4e5aaf425631172f50ae21b6757 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.1441 2021/10/17 14:58:11 tom Exp $
+# $Id: dist.mk,v 1.1442 2021/10/18 23:31:58 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 = 20211017
+NCURSES_PATCH = 20211018
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 67fb421c8ab23247738313b6ef0053c06ac3865e..eacb03a606f14479117057cca464a1cb7aaae092 100644 (file)
@@ -42,7 +42,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_screen.c,v 1.101 2021/06/26 20:43:19 tom Exp $")
+MODULE_ID("$Id: lib_screen.c,v 1.103 2021/10/18 22:40:48 tom Exp $")
 
 #define MAX_SIZE 0x3fff                /* 16k is big enough for a window or pad */
 
@@ -200,7 +200,7 @@ read_txt(FILE *fp)
 
        if (ch == '\n') {
            result[--used] = '\0';
-           T(("READ:%s", result));
+           TR(TRACE_IEVENT, ("READ:%s", result));
        } else if (used == 0) {
            free(result);
            result = 0;
@@ -214,7 +214,7 @@ decode_attr(char *source, attr_t *target, int *color)
 {
     bool found = FALSE;
 
-    T(("decode_attr   '%s'", source));
+    TR(TRACE_IEVENT, ("decode_attr   '%s'", source));
 
     while (*source) {
        if (source[0] == MARKER && source[1] == L_CURL) {
@@ -272,7 +272,7 @@ decode_char(char *source, int *target)
     int base = 16;
     const char digits[] = "0123456789abcdef";
 
-    T(("decode_char   '%s'", source));
+    TR(TRACE_IEVENT, ("decode_char   '%s'", source));
     *target = ' ';
     switch (*source) {
     case MARKER:
@@ -329,7 +329,7 @@ decode_chtype(char *source, chtype fillin, chtype *target)
     int color = PAIR_NUMBER((int) attr);
     int value;
 
-    T(("decode_chtype '%s'", source));
+    TR(TRACE_IEVENT, ("decode_chtype '%s'", source));
     source = decode_attr(source, &attr, &color);
     source = decode_char(source, &value);
     *target = (ChCharOf(value) | attr | (chtype) COLOR_PAIR(color));
@@ -347,7 +347,7 @@ decode_cchar(char *source, cchar_t *fillin, cchar_t *target)
     int append = 0;
     int value = 0;
 
-    T(("decode_cchar  '%s'", source));
+    TR(TRACE_IEVENT, ("decode_cchar  '%s'", source));
     *target = blank;
 #if NCURSES_EXT_COLORS
     color = fillin->ext_color;
@@ -940,6 +940,31 @@ putwin(WINDOW *win, FILE *filep)
     returnCode(code);
 }
 
+/*
+ * Replace a window covering the whole screen, i.e., newscr or curscr.
+ */
+static WINDOW *
+replace_window(WINDOW *target, FILE *source)
+{
+    WINDOW *result = getwin(source);
+#if NCURSES_EXT_FUNCS
+    if (result != NULL) {
+       if (getmaxx(result) != getmaxx(target)
+           || getmaxy(result) != getmaxy(target)) {
+           int code = wresize(result,
+                              1 + getmaxy(target),
+                              1 + getmaxx(target));
+           if (code != OK) {
+               delwin(result);
+               result = NULL;
+           }
+       }
+    }
+#endif
+    delwin(target);
+    return result;
+}
+
 NCURSES_EXPORT(int)
 NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file)
 {
@@ -950,8 +975,7 @@ NCURSES_SP_NAME(scr_restore) (NCURSES_SP_DCLx const char *file)
 
     if (_nc_access(file, R_OK) >= 0
        && (fp = safe_fopen(file, BIN_R)) != 0) {
-       delwin(NewScreen(SP_PARM));
-       NewScreen(SP_PARM) = getwin(fp);
+       NewScreen(SP_PARM) = replace_window(NewScreen(SP_PARM), fp);
 #if !USE_REENTRANT
        newscr = NewScreen(SP_PARM);
 #endif
@@ -1008,8 +1032,7 @@ NCURSES_SP_NAME(scr_init) (NCURSES_SP_DCLx const char *file)
 
        if (_nc_access(file, R_OK) >= 0
            && (fp = safe_fopen(file, BIN_R)) != 0) {
-           delwin(CurScreen(SP_PARM));
-           CurScreen(SP_PARM) = getwin(fp);
+           CurScreen(SP_PARM) = replace_window(CurScreen(SP_PARM), fp);
 #if !USE_REENTRANT
            curscr = CurScreen(SP_PARM);
 #endif
index 729ccb35e53aaea5e17800098e0a0691c945afdd..776ac82539b970c9702d6f17f7051fe45acd381f 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20211017) unstable; urgency=low
+ncurses6 (6.2+20211018) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 17 Oct 2021 10:58:11 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 18 Oct 2021 19:31:58 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index 729ccb35e53aaea5e17800098e0a0691c945afdd..776ac82539b970c9702d6f17f7051fe45acd381f 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20211017) unstable; urgency=low
+ncurses6 (6.2+20211018) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 17 Oct 2021 10:58:11 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 18 Oct 2021 19:31:58 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
index d59c231bfff5b6623e6e160aef822d4f87bb813b..4f42d23857c4195ca7ffd3b0467f9b1fa756bd28 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (6.2+20211017) unstable; urgency=low
+ncurses6 (6.2+20211018) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Sun, 17 Oct 2021 10:58:11 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Mon, 18 Oct 2021 19:31:58 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index 7fa33938a601b3273dc31e2617af977e6ca72902..a9592e27399c2e1717a4efe42881777b0f33a2f7 100644 (file)
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.483 2021/10/17 14:58:11 tom Exp $\r
+; $Id: mingw-ncurses.nsi,v 1.484 2021/10/18 23:31:58 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  "1017"\r
+!define VERSION_MMDD  "1018"\r
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}\r
 \r
 !define MY_ABI   "5"\r
index b907a5673fc583aa1bd3f61cd7e7242f778ec672..c7d7428db8eddd9d9589efdc2e80ae0f67ffcccf 100644 (file)
@@ -3,7 +3,7 @@
 Summary: shared libraries for terminal handling
 Name: mingw32-ncurses6
 Version: 6.2
-Release: 20211017
+Release: 20211018
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 9e9767b3f5760966e5d4bbe28a11e484cef022bf..40457320f3f4d96dc8bcd87078e216f3ad1bd5b3 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.2
-Release: 20211017
+Release: 20211018
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
index 51ab385c227a03a23649d58a520099c5e4292394..f5da76c0eadfa8098d6f62b2dba2f978186a463e 100644 (file)
@@ -1,7 +1,7 @@
 Summary: Curses library with POSIX thread support.
 Name: ncursest6
 Version: 6.2
-Release: 20211017
+Release: 20211018
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz