From: Thomas E. Dickey Date: Sun, 29 Oct 2017 00:35:34 +0000 (+0000) Subject: ncurses 6.0 - patch 20171028 X-Git-Tag: v6.1~13 X-Git-Url: http://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=b5be26931d6488adcb1ff8bc07df9de378ce0d27;hp=58369d647d003dd9d9e1ecfc5ab07982db28f3da ncurses 6.0 - patch 20171028 + improve man/curs_inwstr.3x, correct end-logic for lib_inwstr.c (report by Midolikawa H). + fix typo in a few places for "improvements" (patch by Sven Joachim). + clear the other half of a double-width character on which a line drawing character is drawn. + make test/ncurses.c "s" test easier to understand which subtests are available; add a "S" wide-character overlap test-screen. + modify test/ncurses.c C/c tests to allow for extended color pairs. + add endwin() call in error-returns from test/ncurses.c omitted in recent redesign of its menu (cf: 20170923). + improve install of hashed-db by removing the ".db" file as done for directory-tree terminal databases. + repair a few overlooked items in include/ncurses_defs from recent port/refactoring of test-programs (cf: 20170909). + add test/padview.c, to compare pads with direct updates in view.c --- diff --git a/MANIFEST b/MANIFEST index 86d38eb4..a5b6aac7 100644 --- a/MANIFEST +++ b/MANIFEST @@ -1171,6 +1171,7 @@ ./test/package/debian/watch ./test/package/mingw-ncurses-examples.spec ./test/package/ncurses-examples.spec +./test/padview.c ./test/picsmap.c ./test/popup_msg.c ./test/popup_msg.h diff --git a/NEWS b/NEWS index b023262d..fdc81b1d 100644 --- a/NEWS +++ b/NEWS @@ -25,7 +25,7 @@ -- sale, use or other dealings in this Software without prior written -- -- authorization. -- ------------------------------------------------------------------------------- --- $Id: NEWS,v 1.2979 2017/10/21 20:29:16 tom Exp $ +-- $Id: NEWS,v 1.2991 2017/10/28 23:46:30 tom Exp $ ------------------------------------------------------------------------------- This is a log of changes that ncurses has gone through since Zeyd started @@ -45,6 +45,23 @@ 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. +20171028 + + improve man/curs_inwstr.3x, correct end-logic for lib_inwstr.c + (report by Midolikawa H). + + fix typo in a few places for "improvements" (patch by Sven Joachim). + + clear the other half of a double-width character on which a line + drawing character is drawn. + + make test/ncurses.c "s" test easier to understand which subtests are + available; add a "S" wide-character overlap test-screen. + + modify test/ncurses.c C/c tests to allow for extended color pairs. + + add endwin() call in error-returns from test/ncurses.c omitted in + recent redesign of its menu (cf: 20170923). + + improve install of hashed-db by removing the ".db" file as done for + directory-tree terminal databases. + + repair a few overlooked items in include/ncurses_defs from recent + port/refactoring of test-programs (cf: 20170909). + + add test/padview.c, to compare pads with direct updates in view.c + 20171021 + modify test/view.c to expand tabs using the ncurses library rather than in the test-program. @@ -2742,7 +2759,7 @@ it is not possible to add this information. + regenerated html manpages. 20120107 - + various improvments for MinGW (Juergen Pfeifer): + + various improvements for MinGW (Juergen Pfeifer): + modify stat() calls to ignore the st_size member + drop mk-dlls.sh script. + change recommended regular expression library. @@ -5193,7 +5210,7 @@ it is not possible to add this information. + fix ifdef in c++/internal.h for QNX 6.1 + test-compiled with (old) egcs-1.1.2, modified configure script to not unset the $CXX and related variables which would prevent this. - + fix a few terminfo.src typos exposed by improvments to "-f" option. + + fix a few terminfo.src typos exposed by improvements to "-f" option. + improve infocmp/tic "-f" option formatting. 20060923 diff --git a/VERSION b/VERSION index 3161a8d1..7914d5b2 100644 --- a/VERSION +++ b/VERSION @@ -1 +1 @@ -5:0:9 6.0 20171021 +5:0:9 6.0 20171028 diff --git a/dist.mk b/dist.mk index 71921f34..04eef89b 100644 --- a/dist.mk +++ b/dist.mk @@ -25,7 +25,7 @@ # use or other dealings in this Software without prior written # # authorization. # ############################################################################## -# $Id: dist.mk,v 1.1188 2017/10/15 14:51:52 tom Exp $ +# $Id: dist.mk,v 1.1189 2017/10/22 10:49:45 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 = 0 -NCURSES_PATCH = 20171021 +NCURSES_PATCH = 20171028 # 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 caa27fd0..3b1cb260 100644 --- a/doc/html/man/adacurses6-config.1.html +++ b/doc/html/man/adacurses6-config.1.html @@ -125,7 +125,7 @@

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/captoinfo.1m.html b/doc/html/man/captoinfo.1m.html
index 968588ec..a435d395 100644
--- a/doc/html/man/captoinfo.1m.html
+++ b/doc/html/man/captoinfo.1m.html
@@ -190,7 +190,7 @@
 

SEE ALSO

        infocmp(1m), curses(3x), terminfo(5)
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 

AUTHOR

diff --git a/doc/html/man/clear.1.html b/doc/html/man/clear.1.html
index bbefd61c..2f499b75 100644
--- a/doc/html/man/clear.1.html
+++ b/doc/html/man/clear.1.html
@@ -148,7 +148,7 @@
 

SEE ALSO

        tput(1), terminfo(5)
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/curs_inch.3x.html b/doc/html/man/curs_inch.3x.html
index 6d376744..c1c25140 100644
--- a/doc/html/man/curs_inch.3x.html
+++ b/doc/html/man/curs_inch.3x.html
@@ -27,7 +27,7 @@
   * sale, use or other dealings in this Software without prior written       *
   * authorization.                                                           *
   ****************************************************************************
-  * @Id: curs_inch.3x,v 1.18 2017/10/14 19:14:47 tom Exp @
+  * @Id: curs_inch.3x,v 1.19 2017/10/28 20:16:52 Sven.Joachim Exp @
 -->
 
 
@@ -107,7 +107,7 @@
        o   System  V  curses  added support for several video attributes which
            could be combined with characters in the window.
 
-           Reflecting this improvment, the function was altered to return  the
+           Reflecting this improvement, the function was altered to return the
            character combined with all video attributes in a chtype value.
 
        X/Open Curses does not specify the size and layout of attributes, color
diff --git a/doc/html/man/curs_inwstr.3x.html b/doc/html/man/curs_inwstr.3x.html
index 2b9b5291..3b8608aa 100644
--- a/doc/html/man/curs_inwstr.3x.html
+++ b/doc/html/man/curs_inwstr.3x.html
@@ -1,6 +1,6 @@
 
 
 
@@ -53,39 +53,44 @@
 

SYNOPSIS

        #include <curses.h>
 
-       int inwstr(wchar_t *str);
-       int innwstr(wchar_t *str, int n);
-       int winwstr(WINDOW *win, wchar_t *str);
-       int winnwstr(WINDOW *win, wchar_t *str, int n);
-       int mvinwstr(int y, int x, wchar_t *str);
-       int mvinnwstr(int y, int x, wchar_t *str, int n);
-       int mvwinwstr(WINDOW *win, int y, int x, wchar_t *str);
-       int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *str, int n);
+       int inwstr(wchar_t *wstr);
+       int innwstr(wchar_t *wstr, int n);
+       int winwstr(WINDOW *win, wchar_t *wstr);
+       int winnwstr(WINDOW *win, wchar_t *wstr, int n);
+       int mvinwstr(int y, int x, wchar_t *wstr);
+       int mvinnwstr(int y, int x, wchar_t *wstr, int n);
+       int mvwinwstr(WINDOW *win, int y, int x, wchar_t *wstr);
+       int mvwinnwstr(WINDOW *win, int y, int x, wchar_t *wstr, int n);
 
 
 

DESCRIPTION

-       These routines return a string of wchar_t characters in wstr, extracted
-       starting   at   the  current  cursor  position  in  the  named  window.
-       Attributes are stripped from the characters.  The four functions with n
-       as  the  last  argument return a leading substring at most n bytes long
-       (exclusive of the trailing NUL).  Transfer stops at the end of the cur-
-       rent  line, or when n bytes have been stored at the location referenced
-       by wstr.
+       These routines return a string of  wchar_t  wide  characters  in  wstr,
+       extracted starting at the current cursor position in the named window.
 
-       If the size n is not large enough to store  a  complete  character,  an
-       error is generated.
+       The  four  functions  with n as the last argument return a leading sub-
+       string at most n characters  long  (exclusive  of  the  trailing  NUL).
+       Transfer  stops  at  the  end of the current line, or when n characters
+       have been stored at the location referenced by wstr.
+
+       If the size n is not large enough to store a complete  complex  charac-
+       ter, an error is generated.
 
 
 

NOTES

-       Note that all routines except winnwstr may be macros.
+       All routines except winnwstr may be macros.
+
+       Each cell in the window holds a complex character (i.e., base- and com-
+       bining-characters) together with attributes and color.  These functions
+       store  only  the  wide  characters, ignoring attributes and color.  Use
+       in_wchstr to return the complex characters from a window.
 
 
 

RETURN VALUE

-       All  routines  return ERR upon failure. Upon successful completion, the
+       All routines return ERR upon failure. Upon successful  completion,  the
        *inwstr routines return OK, and the *innwstr routines return the number
        of characters read into the string.
 
-       Functions  with  a  "mv"  prefix  first perform a cursor movement using
+       Functions with a "mv" prefix first  perform  a  cursor  movement  using
        wmove, and return an error if the position is outside the window, or if
        the window pointer is null.
 
diff --git a/doc/html/man/form.3x.html b/doc/html/man/form.3x.html
index 8a6a1fcd..68632a19 100644
--- a/doc/html/man/form.3x.html
+++ b/doc/html/man/form.3x.html
@@ -234,7 +234,7 @@
        curses(3x)  and  related  pages  whose names begin "form_" for detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/infocmp.1m.html b/doc/html/man/infocmp.1m.html
index 8658f777..cee761d9 100644
--- a/doc/html/man/infocmp.1m.html
+++ b/doc/html/man/infocmp.1m.html
@@ -476,7 +476,7 @@
 
        http://invisible-island.net/ncurses/tctest.html
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 

AUTHOR

diff --git a/doc/html/man/infotocap.1m.html b/doc/html/man/infotocap.1m.html
index 3006556b..a8e213f5 100644
--- a/doc/html/man/infotocap.1m.html
+++ b/doc/html/man/infotocap.1m.html
@@ -85,7 +85,7 @@
 

SEE ALSO

        curses(3x), tic(1m), infocmp(1m), terminfo(5)
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 

AUTHOR

diff --git a/doc/html/man/menu.3x.html b/doc/html/man/menu.3x.html
index 9d1f818b..3013aac0 100644
--- a/doc/html/man/menu.3x.html
+++ b/doc/html/man/menu.3x.html
@@ -210,7 +210,7 @@
        curses(3x) and related pages whose names  begin  "menu_"  for  detailed
        descriptions of the entry points.
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/ncurses.3x.html b/doc/html/man/ncurses.3x.html
index 17a0fead..86378eb9 100644
--- a/doc/html/man/ncurses.3x.html
+++ b/doc/html/man/ncurses.3x.html
@@ -59,7 +59,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.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
        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 19ce50e1..e44bcdb5 100644
--- a/doc/html/man/ncurses6-config.1.html
+++ b/doc/html/man/ncurses6-config.1.html
@@ -112,7 +112,7 @@
 

SEE ALSO

        curses(3x)
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/panel.3x.html b/doc/html/man/panel.3x.html
index ab84cd47..014d58e0 100644
--- a/doc/html/man/panel.3x.html
+++ b/doc/html/man/panel.3x.html
@@ -194,7 +194,7 @@
 

SEE ALSO

        curses(3x), curs_variables(3x),
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 

AUTHOR

diff --git a/doc/html/man/tabs.1.html b/doc/html/man/tabs.1.html
index 86255f61..8ce3ea25 100644
--- a/doc/html/man/tabs.1.html
+++ b/doc/html/man/tabs.1.html
@@ -164,7 +164,7 @@
 

SEE ALSO

        tset(1), infocmp(1m), curses(3x), terminfo(5).
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/terminfo.5.html b/doc/html/man/terminfo.5.html
index 7e52bd52..e4202c53 100644
--- a/doc/html/man/terminfo.5.html
+++ b/doc/html/man/terminfo.5.html
@@ -74,7 +74,7 @@
        Terminfo describes terminals by giving a set of capabilities which they
        have, by specifying how to perform screen operations, and by specifying
        padding  requirements  and  initialization  sequences.   This describes
-       ncurses version 6.0 (patch 20171014).
+       ncurses version 6.0 (patch 20171028).
 
 
 

Terminfo Entry Syntax

diff --git a/doc/html/man/tic.1m.html b/doc/html/man/tic.1m.html
index 27e64e35..960c2711 100644
--- a/doc/html/man/tic.1m.html
+++ b/doc/html/man/tic.1m.html
@@ -364,7 +364,7 @@
        infocmp(1m),   captoinfo(1m),   infotocap(1m),   toe(1m),   curses(3x),
        term(5).  terminfo(5).
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 

AUTHOR

diff --git a/doc/html/man/toe.1m.html b/doc/html/man/toe.1m.html
index 718f40aa..d6f6307f 100644
--- a/doc/html/man/toe.1m.html
+++ b/doc/html/man/toe.1m.html
@@ -113,7 +113,7 @@
        tic(1m), infocmp(1m), captoinfo(1m),  infotocap(1m),  curses(3x),  ter-
        minfo(5).
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/tput.1.html b/doc/html/man/tput.1.html
index a855831c..50b7a896 100644
--- a/doc/html/man/tput.1.html
+++ b/doc/html/man/tput.1.html
@@ -482,7 +482,7 @@
 

SEE ALSO

        clear(1), stty(1), tabs(1), tset(1), terminfo(5), curs_termcap(3x).
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/doc/html/man/tset.1.html b/doc/html/man/tset.1.html
index 40b12eb3..24a58a80 100644
--- a/doc/html/man/tset.1.html
+++ b/doc/html/man/tset.1.html
@@ -389,7 +389,7 @@
        csh(1),  sh(1),  stty(1),   curs_terminfo(3x),   tty(4),   terminfo(5),
        ttys(5), environ(7)
 
-       This describes ncurses version 6.0 (patch 20171014).
+       This describes ncurses version 6.0 (patch 20171028).
 
 
 
diff --git a/include/ncurses_defs b/include/ncurses_defs
index 66995015..86ca9378 100644
--- a/include/ncurses_defs
+++ b/include/ncurses_defs
@@ -1,4 +1,4 @@
-# $Id: ncurses_defs,v 1.81 2017/09/29 23:56:38 tom Exp $
+# $Id: ncurses_defs,v 1.83 2017/10/22 23:53:00 tom Exp $
 ##############################################################################
 # Copyright (c) 2000-2016,2017 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -55,6 +55,7 @@ HAVE_COLOR_SET	1
 HAVE_COPYWIN	1
 HAVE_CURSCR	1
 HAVE_CURSES_DATA_TTYTYPE	1
+HAVE_DELSCREEN	1
 HAVE_DERWIN	1
 HAVE_DIRENT_H
 HAVE_DUPWIN	1
@@ -106,7 +107,9 @@ HAVE_MBSTOWCS
 HAVE_MBTOWC
 HAVE_MENU_H
 HAVE_MKSTEMP
+HAVE_MVDERWIN	1
 HAVE_MVVLINE	1
+HAVE_MVWIN	1
 HAVE_MVWVLINE	1
 HAVE_NANOSLEEP
 HAVE_NC_ALLOC_H
@@ -124,6 +127,7 @@ HAVE_REGEX_H_FUNCS
 HAVE_REMOVE
 HAVE_RESIZETERM
 HAVE_RESIZE_TERM
+HAVE_RESTARTTERM	1
 HAVE_RIPOFFLINE	1
 HAVE_SCR_DUMP 1
 HAVE_SELECT
@@ -188,11 +192,14 @@ HAVE_VIDPUTS	1
 HAVE_VID_PUTS	1
 HAVE_VSNPRINTF
 HAVE_VSSCANF
+HAVE_VW_PRINTW	1
+HAVE_WCHGAT	1
 HAVE_WCSRTOMBS
 HAVE_WCSTOMBS
 HAVE_WCTOB 
 HAVE_WCTOMB
 HAVE_WCTYPE_H
+HAVE_WINSDELLN	1
 HAVE_WINSSTR	1
 HAVE_WORKING_POLL
 HAVE_WRESIZE
diff --git a/man/curs_inch.3x b/man/curs_inch.3x
index 4fe29e43..3386900a 100644
--- a/man/curs_inch.3x
+++ b/man/curs_inch.3x
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_inch.3x,v 1.18 2017/10/14 19:14:47 tom Exp $
+.\" $Id: curs_inch.3x,v 1.19 2017/10/28 20:16:52 Sven.Joachim Exp $
 .TH curs_inch 3X ""
 .de bP
 .IP \(bu 4
@@ -89,7 +89,7 @@ with the \fIstandout\fP attribute removed.
 System V curses added support for several video attributes which
 could be combined with characters in the window.
 .IP
-Reflecting this improvment, the function was altered to return the
+Reflecting this improvement, the function was altered to return the
 character combined with all video attributes in a \fBchtype\fP value.
 .PP
 X/Open Curses does not specify 
diff --git a/man/curs_inwstr.3x b/man/curs_inwstr.3x
index 0cdf4d8d..63ebed0b 100644
--- a/man/curs_inwstr.3x
+++ b/man/curs_inwstr.3x
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 2002-2010,2012 Free Software Foundation, Inc.              *
+.\" Copyright (c) 2002-2012,2017 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            *
@@ -26,7 +26,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_inwstr.3x,v 1.8 2012/11/03 23:03:59 tom Exp $
+.\" $Id: curs_inwstr.3x,v 1.9 2017/10/28 23:42:58 tom Exp $
 .TH curs_inwstr 3X ""
 .SH NAME
 \fBinwstr\fR,
@@ -41,37 +41,45 @@
 .nf
 \fB#include  \fR
 .sp
-\fBint inwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB);\fR
+\fBint inwstr(\fR\fBwchar_t *\fR\fIwstr\fR\fB);\fR
 .br
-\fBint innwstr(\fR\fBwchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR
+\fBint innwstr(\fR\fBwchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
 .br
-\fBint winwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR
+\fBint winwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIwstr\fR\fB);\fR
 .br
-\fBint winnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR
+\fBint winnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
 .br
-\fBint mvinwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR
+\fBint mvinwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIwstr\fR\fB);\fR
 .br
-\fBint mvinnwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR
+\fBint mvinnwstr(\fR\fBint \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
 .br
-\fBint mvwinwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB);\fR
+\fBint mvwinwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIwstr\fR\fB);\fR
 .br
-\fBint mvwinnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIstr\fR\fB, int \fR\fIn\fR\fB);\fR
+\fBint mvwinnwstr(\fR\fBWINDOW *\fR\fIwin\fR\fB, int \fR\fIy\fR\fB, int \fR\fIx\fR\fB, wchar_t *\fR\fIwstr\fR\fB, int \fR\fIn\fR\fB);\fR
 .fi
 .SH DESCRIPTION
-These routines return a string of \fBwchar_t\fR characters in \fIwstr\fR,
+.PP
+These routines return a string of \fBwchar_t\fR wide characters in \fIwstr\fR,
 extracted starting at the current cursor position in the named window.
-Attributes are stripped from the characters.
+.PP
 The four functions with \fIn\fR as the last argument return a leading substring at most
-\fIn\fR bytes long (exclusive of the trailing NUL).
-Transfer stops at the end of the current line, or when \fIn\fR bytes have
+\fIn\fR characters long (exclusive of the trailing NUL).
+Transfer stops at the end of the current line, or when \fIn\fR characters have
 been stored at the location referenced by \fIwstr\fR.
 .PP
-If the size \fIn\fR is not large enough to store a complete character,
+If the size \fIn\fR is not large enough to store a complete complex character,
 an error is generated.
 .SH NOTES
-Note that all routines except
+.PP
+All routines except
 \fBwinnwstr\fR
 may be macros.
+.PP
+Each cell in the window holds a complex character (i.e., base-
+and combining-characters) together with attributes and color.
+These functions store only the wide characters,
+ignoring attributes and color.
+Use \fBin_wchstr\fP to return the complex characters from a window.
 .SH RETURN VALUE
 All routines return
 \fBERR\fR
diff --git a/misc/run_tic.in b/misc/run_tic.in
index 784f9f42..ef2e2651 100644
--- a/misc/run_tic.in
+++ b/misc/run_tic.in
@@ -1,7 +1,7 @@
 #!@SHELL@
-# $Id: run_tic.in,v 1.34 2012/10/06 19:00:51 tom Exp $
+# $Id: run_tic.in,v 1.35 2017/10/24 00:16:22 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2012,2017 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 "Software"), #
@@ -36,7 +36,7 @@
 # Assumes:
 #	The leaf directory names (lib, tabset, terminfo)
 #
-echo '** Building terminfo database, please wait...'
+echo "** Building terminfo database, please wait..."
 #
 # The script is designed to be run from the misc/Makefile as
 #	make install.data
@@ -84,7 +84,7 @@ then
 		fi
 	elif test "$TIC_PATH" = unknown
 	then
-		echo '? no tic program found'
+		echo "? no tic program found"
 		exit 1
 	fi
 else
@@ -105,11 +105,12 @@ SHLIB_HOST=@host_os@
 export SHLIB_HOST
 
 # don't use user's TERMINFO variable
-TERMINFO=${DESTDIR}$ticdir ; export TERMINFO
+unset TERMINFO_DIRS
+TERMINFO="${DESTDIR}$ticdir" ; export TERMINFO
 umask 022
 
 # Construct the name of the old (obsolete) pathname, e.g., /usr/lib/terminfo.
-TICDIR=`echo $TERMINFO | sed -e 's%/share/\([^/]*\)$%/lib/\1%'`
+TICDIR=`echo "$TERMINFO" | sed -e 's%/share/\([^/]*\)$%/lib/\1%'`
 
 # Parent directory may not exist, which would confuse the install for hashed
 # database.  Fix.
@@ -123,7 +124,13 @@ fi
 # would generate a lot of confusing error messages if we tried to overwrite it.
 # We explicitly remove its contents rather than the directory itself, in case
 # the directory is actually a symbolic link.
-( test -d "$TERMINFO" && cd $TERMINFO && rm -fr ? 2>/dev/null )
+if test -d "$TERMINFO"
+then
+	( cd "$TERMINFO" && rm -fr ? 2>/dev/null )
+elif test -f "$TERMINFO.db"
+then
+	( rm -f "$TERMINFO.db" 2>/dev/null )
+fi
 
 if test "$ext_funcs" = 1 ; then
 cat </dev/null )
-	if ( cd $TICDIR 2>/dev/null )
+	( rm -f "$TICDIR" 2>/dev/null )
+	if ( cd "$TICDIR" 2>/dev/null )
 	then
-		cd $TICDIR
+		cd "$TICDIR"
 		TICDIR=`pwd`
-		if test $TICDIR != $TERMINFO ; then
+		if test "$TICDIR "!= "$TERMINFO "; then
 			# Well, we tried.  Some systems lie to us, so the
 			# installer will have to double-check.
 			echo "Verify if $TICDIR and $TERMINFO are the same."
@@ -190,11 +197,11 @@ if test "$TICDIR" != "$TERMINFO" ; then
 		if test "$RELATIVE" != "$ticdir" ; then
 			RELATIVE=../`echo $ticdir|sed -e 's%^'$prefix'/%%' -e 's%^/%%'`
 		fi
-		if ( @LN_S@ $RELATIVE $TICDIR )
+		if ( @LN_S@ "$RELATIVE" "$TICDIR" )
 		then
-			echo '** sym-linked '$TICDIR' for compatibility'
+			echo "** sym-linked $TICDIR for compatibility"
 		else
-			echo '** could not sym-link '$TICDIR' for compatibility'
+			echo "** could not sym-link $TICDIR for compatibility"
 		fi
 	fi
 fi
diff --git a/ncurses/base/lib_box.c b/ncurses/base/lib_box.c
index 6f17c97a..dccb8e12 100644
--- a/ncurses/base/lib_box.c
+++ b/ncurses/base/lib_box.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2017 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            *
@@ -42,7 +42,7 @@
 
 #include 
 
-MODULE_ID("$Id: lib_box.c,v 1.24 2010/04/24 23:51:57 tom Exp $")
+MODULE_ID("$Id: lib_box.c,v 1.25 2017/10/27 21:56:17 tom Exp $")
 
 #if USE_WIDEC_SUPPORT
 static NCURSES_INLINE chtype
@@ -114,10 +114,20 @@ wborder(WINDOW *win,
     win->_line[endy].lastchar = win->_line[0].lastchar = endx;
 
     for (i = 0; i <= endy; i++) {
+#if USE_WIDEC_SUPPORT
+	if (endx > 0 && isWidecExt(win->_line[i].text[endx])) {
+	    SetChar2(win->_line[i].text[endx - 1], ' ');
+	}
+#endif
 	SetChar2(win->_line[i].text[0], wls);
 	SetChar2(win->_line[i].text[endx], wrs);
 	win->_line[i].firstchar = 0;
 	win->_line[i].lastchar = endx;
+#if USE_WIDEC_SUPPORT
+	if (isWidecExt(win->_line[i].text[1])) {
+	    SetChar2(win->_line[i].text[1], ' ');
+	}
+#endif
     }
     SetChar2(win->_line[0].text[0], wtl);
     SetChar2(win->_line[0].text[endx], wtr);
diff --git a/ncurses/base/lib_color.c b/ncurses/base/lib_color.c
index 433b1641..8871159f 100644
--- a/ncurses/base/lib_color.c
+++ b/ncurses/base/lib_color.c
@@ -48,7 +48,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_color.c,v 1.135 2017/08/19 23:48:19 tom Exp $")
+MODULE_ID("$Id: lib_color.c,v 1.136 2017/10/22 15:19:37 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define CanChange      InfoOf(SP_PARM).canchange
@@ -547,7 +547,7 @@ _nc_reserve_pairs(SCREEN *sp, int want)
 	    TYPE_REALLOC(colorpair_t, have, sp->_color_pairs);
 	    if (sp->_color_pairs != 0) {
 		memset(sp->_color_pairs + sp->_pair_alloc, 0,
-		       sizeof(colorpair_t) * (have - sp->_pair_alloc));
+		       sizeof(colorpair_t) * (size_t) (have - sp->_pair_alloc));
 	    }
 #endif
 	}
diff --git a/ncurses/base/lib_hline.c b/ncurses/base/lib_hline.c
index 32f0b477..0fac51de 100644
--- a/ncurses/base/lib_hline.c
+++ b/ncurses/base/lib_hline.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2016,2017 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            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim  1992,1995               *
  *     and: Eric S. Raymond                          *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Sven Verdoolaege                        2001                    *
  ****************************************************************************/
 
 /*
@@ -40,7 +42,7 @@
 
 #include 
 
-MODULE_ID("$Id: lib_hline.c,v 1.14 2016/05/28 23:11:26 tom Exp $")
+MODULE_ID("$Id: lib_hline.c,v 1.15 2017/10/28 19:57:42 tom Exp $")
 
 NCURSES_EXPORT(int)
 whline(WINDOW *win, chtype ch, int n)
@@ -66,6 +68,14 @@ whline(WINDOW *win, chtype ch, int n)
 	    SetChar2(wch, ch);
 	wch = _nc_render(win, wch);
 
+#if USE_WIDEC_SUPPORT
+	if (start > 0 && isWidecExt(line->text[start])) {
+	    SetChar2(line->text[start - 1], ' ');
+	}
+	if (end < win->_maxx && isWidecExt(line->text[end + 1])) {
+	    SetChar2(line->text[end + 1], ' ');
+	}
+#endif
 	while (end >= start) {
 	    line->text[end] = wch;
 	    end--;
diff --git a/ncurses/base/lib_pad.c b/ncurses/base/lib_pad.c
index b87498b5..8c7e5af0 100644
--- a/ncurses/base/lib_pad.c
+++ b/ncurses/base/lib_pad.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2017 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            *
@@ -42,7 +42,7 @@
 
 #include 
 
-MODULE_ID("$Id: lib_pad.c,v 1.46 2010/04/24 23:50:45 tom Exp $")
+MODULE_ID("$Id: lib_pad.c,v 1.47 2017/10/22 19:57:26 tom Exp $")
 
 NCURSES_EXPORT(WINDOW *)
 NCURSES_SP_NAME(newpad) (NCURSES_SP_DCLx int l, int c)
@@ -188,6 +188,12 @@ pnoutrefresh(WINDOW *win,
 
     T(("pad being refreshed"));
 
+#ifdef TRACE
+    if (USE_TRACEF(TRACE_UPDATE)) {
+	_tracedump("...pad", win);
+	_nc_unlock_global(tracef);
+    }
+#endif /* TRACE */
 #if USE_SCROLL_HINTS
     if (win->_pad._pad_y >= 0) {
 	displaced = pminrow - win->_pad._pad_y
diff --git a/ncurses/base/lib_vline.c b/ncurses/base/lib_vline.c
index bb06e1b9..acb5dfd1 100644
--- a/ncurses/base/lib_vline.c
+++ b/ncurses/base/lib_vline.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2016,2017 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            *
@@ -29,6 +29,8 @@
 /****************************************************************************
  *  Author: Zeyd M. Ben-Halim  1992,1995               *
  *     and: Eric S. Raymond                          *
+ *     and: Thomas E. Dickey                        1996-on                 *
+ *     and: Sven Verdoolaege                        2001                    *
  ****************************************************************************/
 
 /*
@@ -40,7 +42,7 @@
 
 #include 
 
-MODULE_ID("$Id: lib_vline.c,v 1.13 2016/05/28 23:11:26 tom Exp $")
+MODULE_ID("$Id: lib_vline.c,v 1.14 2017/10/28 19:55:44 tom Exp $")
 
 NCURSES_EXPORT(int)
 wvline(WINDOW *win, chtype ch, int n)
@@ -66,6 +68,14 @@ wvline(WINDOW *win, chtype ch, int n)
 
 	while (end >= row) {
 	    struct ldat *line = &(win->_line[end]);
+#if USE_WIDEC_SUPPORT
+	    if (col > 0 && isWidecExt(line->text[col])) {
+		SetChar2(line->text[col - 1], ' ');
+	    }
+	    if (col < win->_maxx && isWidecExt(line->text[col + 1])) {
+		SetChar2(line->text[col + 1], ' ');
+	    }
+#endif
 	    line->text[col] = wch;
 	    CHANGED_CELL(line, col);
 	    end--;
diff --git a/ncurses/tinfo/make_hash.c b/ncurses/tinfo/make_hash.c
index 692113b5..26d9b834 100644
--- a/ncurses/tinfo/make_hash.c
+++ b/ncurses/tinfo/make_hash.c
@@ -44,7 +44,7 @@
 
 #include 
 
-MODULE_ID("$Id: make_hash.c,v 1.14 2017/06/23 23:53:13 tom Exp $")
+MODULE_ID("$Id: make_hash.c,v 1.15 2017/10/23 21:19:54 tom Exp $")
 
 /*
  *	_nc_make_hash_table()
@@ -328,7 +328,7 @@ main(int argc, char **argv)
     free(hash_table);
 #if NO_LEAKS
     for (n = 0; (n < CAPTABSIZE); ++n) {
-	free((char *) name_table[n].nte_name);
+	free((void *) name_table[n].nte_name);
     }
     free(name_table);
 #endif
diff --git a/ncurses/widechar/lib_inwstr.c b/ncurses/widechar/lib_inwstr.c
index 76b1508b..3443ec6c 100644
--- a/ncurses/widechar/lib_inwstr.c
+++ b/ncurses/widechar/lib_inwstr.c
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2002-2011,2016 Free Software Foundation, Inc.              *
+ * Copyright (c) 2002-2016,2017 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            *
@@ -39,7 +39,7 @@
 
 #include 
 
-MODULE_ID("$Id: lib_inwstr.c,v 1.7 2016/05/28 23:36:34 tom Exp $")
+MODULE_ID("$Id: lib_inwstr.c,v 1.8 2017/10/29 00:03:29 tom Exp $")
 
 NCURSES_EXPORT(int)
 winnwstr(WINDOW *win, wchar_t *wstr, int n)
@@ -52,11 +52,12 @@ winnwstr(WINDOW *win, wchar_t *wstr, int n)
 	if (win) {
 	    int row, col;
 	    int last = 0;
+	    bool done = FALSE;
 
 	    getyx(win, row, col);
 
 	    text = win->_line[row].text;
-	    while (count < n && count != ERR) {
+	    while (count < n && !done && count != ERR) {
 
 		if (!isWidecExt(text[col])) {
 		    int inx;
@@ -66,8 +67,11 @@ winnwstr(WINDOW *win, wchar_t *wstr, int n)
 			 && ((wch = text[col].chars[inx]) != 0);
 			 ++inx) {
 			if (count + 1 > n) {
-			    if ((count = last) == 0) {
+			    done = TRUE;
+			    if (last == 0) {
 				count = ERR;	/* error if we store nothing */
+			    } else {
+				count = last;	/* only store complete chars */
 			    }
 			    break;
 			}
diff --git a/package/debian-mingw/changelog b/package/debian-mingw/changelog
index 79dd880f..5a99b085 100644
--- a/package/debian-mingw/changelog
+++ b/package/debian-mingw/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20171021) unstable; urgency=low
+ncurses6 (6.0+20171028) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sun, 15 Oct 2017 10:51:52 -0400
+ -- Thomas E. Dickey   Sun, 22 Oct 2017 06:49:45 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian-mingw64/changelog b/package/debian-mingw64/changelog
index 79dd880f..5a99b085 100644
--- a/package/debian-mingw64/changelog
+++ b/package/debian-mingw64/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20171021) unstable; urgency=low
+ncurses6 (6.0+20171028) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sun, 15 Oct 2017 10:51:52 -0400
+ -- Thomas E. Dickey   Sun, 22 Oct 2017 06:49:45 -0400
 
 ncurses6 (5.9-20131005) unstable; urgency=low
 
diff --git a/package/debian/changelog b/package/debian/changelog
index 975ce46d..781de02b 100644
--- a/package/debian/changelog
+++ b/package/debian/changelog
@@ -1,8 +1,8 @@
-ncurses6 (6.0+20171021) unstable; urgency=low
+ncurses6 (6.0+20171028) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey   Sun, 15 Oct 2017 10:51:52 -0400
+ -- Thomas E. Dickey   Sun, 22 Oct 2017 06:49:45 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
diff --git a/package/mingw-ncurses.nsi b/package/mingw-ncurses.nsi
index e232786e..c77b4b7f 100644
--- a/package/mingw-ncurses.nsi
+++ b/package/mingw-ncurses.nsi
@@ -1,4 +1,4 @@
-; $Id: mingw-ncurses.nsi,v 1.236 2017/10/15 14:51:52 tom Exp $
+; $Id: mingw-ncurses.nsi,v 1.237 2017/10/22 10:49:45 tom Exp $
 
 ; TODO add examples
 ; TODO bump ABI to 6
@@ -10,7 +10,7 @@
 !define VERSION_MAJOR "6"
 !define VERSION_MINOR "0"
 !define VERSION_YYYY  "2017"
-!define VERSION_MMDD  "1021"
+!define VERSION_MMDD  "1028"
 !define VERSION_PATCH ${VERSION_YYYY}${VERSION_MMDD}
 
 !define MY_ABI   "5"
diff --git a/package/mingw-ncurses.spec b/package/mingw-ncurses.spec
index e209ad3a..ec1d5a5a 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.0
-Release: 20171021
+Release: 20171028
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/package/ncurses.spec b/package/ncurses.spec
index 9f2de511..aec428ba 100644
--- a/package/ncurses.spec
+++ b/package/ncurses.spec
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Version: 6.0
-Release: 20171021
+Release: 20171028
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{version}-%{release}.tgz
diff --git a/test/README b/test/README
index 28223a63..bcfccf70 100644
--- a/test/README
+++ b/test/README
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: README,v 1.61 2017/06/24 18:42:23 tom Exp $
+-- $Id: README,v 1.63 2017/10/23 00:00:21 tom Exp $
 -------------------------------------------------------------------------------
 
 The programs in this directory are used to test and demonstrate ncurses.
@@ -231,12 +231,12 @@ unpost_menu			test: demo_menus ncurses
 libncurses:
 ----------
 BC				test: demo_termcap
-COLORS				test: demo_new_pair dots_curses echochar ncurses picsmap savescreen xmas
-COLOR_PAIR			test: background blue bs cardfile clip_printw demo_forms demo_menus demo_panels dots_curses echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
-COLOR_PAIRS			test: demo_new_pair dots_curses echochar ncurses newdemo savescreen
-COLS				test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_curses echochar filter firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
+COLORS				test: demo_new_pair dots_curses dots_xcurses echochar ncurses picsmap savescreen xmas
+COLOR_PAIR			test: background blue bs cardfile clip_printw demo_forms demo_menus demo_panels dots_curses echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+COLOR_PAIRS			test: demo_new_pair dots_curses dots_xcurses echochar ncurses newdemo savescreen
+COLS				test: cardfile demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto dots_curses dots_xcurses echochar filter firework foldkeys hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
 ESCDELAY			test: test_opaque
-LINES				test: cardfile demo_defkey demo_keyok demo_menus demo_panels ditto dots_curses echochar firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+LINES				test: cardfile demo_defkey demo_keyok demo_menus demo_panels ditto dots_curses dots_xcurses echochar firework hanoi hashtest inch_wide inchs ins_wide inserts lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
 PAIR_NUMBER			test: ncurses
 PC				test: demo_termcap
 SP				lib: form
@@ -246,29 +246,29 @@ acs_map				test: background gdc ins_wide inserts knight movewindow ncurses newde
 add_wch				test: demo_new_pair demo_panels ncurses picsmap test_add_wchstr test_addwstr
 add_wchnstr			test: test_add_wchstr
 add_wchstr			test: test_add_wchstr view
-addch				test: background blue bs dots_curses echochar hashtest ncurses picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
+addch				test: background blue bs dots_curses echochar hashtest ncurses padview picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_opaque testaddch view worm
 addchnstr			test: test_addchstr
 addchstr			test: test_addchstr
 addnstr				test: test_addstr
-addnwstr			test: ncurses test_addwstr
+addnwstr			test: dots_xcurses ncurses test_addwstr
 addstr				test: blue bs cardfile filter gdc hanoi lrtest ncurses test_addstr
 addwstr				test: blue test_addwstr
-alloc_pair			test: demo_new_pair
+alloc_pair			test: demo_new_pair dots_xcurses
 alloc_pair_sp			-
 assume_default_colors		test: background ncurses
 assume_default_colors_sp	-
 attr_get			-
-attr_off			test: ncurses
-attr_on				test: ncurses
+attr_off			test: dots_xcurses ncurses
+attr_on				test: dots_xcurses ncurses
 attr_set			test: ncurses
 attroff				test: blue dots_curses echochar filter gdc ncurses tclock
 attron				test: blue bs dots_curses echochar filter gdc ncurses
 attrset				test: bs filter firework gdc hanoi insdelln ncurses picsmap rain tclock testaddch testcurs
 baudrate			test: ncurses
 baudrate_sp			test: sp_tinfo
-beep				test: blue bs cardfile chgat clip_printw demo_forms demo_menus demo_new_pair demo_panels edit_field hanoi inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses popup_msg rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
+beep				test: blue bs cardfile chgat clip_printw demo_forms demo_menus demo_new_pair demo_panels edit_field firstlast hanoi inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses padview popup_msg rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
 beep_sp				lib: ncurses
-bkgd				test: background cardfile demo_forms ncurses savescreen tclock view
+bkgd				test: background cardfile demo_forms ncurses padview savescreen tclock view
 bkgdset				test: background ncurses testaddch
 bkgrnd				test: ncurses
 bkgrndset			test: ncurses
@@ -281,22 +281,22 @@ box				test: cardfile chgat clip_printw demo_forms demo_menus demo_panels ditto
 box_set				test: ncurses
 can_change_color		test: extended_color ncurses
 can_change_color_sp		test: extended_color
-cbreak				test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+cbreak				test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo padview picsmap savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
 cbreak_sp			test: sp_tinfo
 chgat				test: chgat
-clear				test: blue bs filter gdc ncurses testcurs xmas
+clear				test: blue bs filter gdc ncurses padview testcurs xmas
 clearok				test: bs knight
-clrtobot			test: demo_menus ncurses
-clrtoeol			test: blue bs demo_altkeys filter foldkeys form_driver_w hanoi hashtest movewindow ncurses view
+clrtobot			test: demo_menus ncurses view
+clrtoeol			test: blue bs demo_altkeys filter foldkeys form_driver_w hanoi hashtest movewindow ncurses padview view
 color_content			test: ncurses picsmap
 color_content_sp		-
-color_set			test: color_set extended_color ncurses
+color_set			test: color_set dots_xcurses extended_color ncurses
 copywin				test: ncurses testcurs
 cur_term			test: demo_termcap demo_terminfo dots dots_mvcur filter list_keys lrtest sp_tinfo test_sgr test_vid_puts test_vidputs progs: clear_cmd reset_cmd tabs tput tset
-curs_set			test: demo_new_pair echochar firework gdc hanoi lrtest ncurses newdemo rain savescreen tclock testcurs worm xmas
+curs_set			test: demo_new_pair echochar firework gdc hanoi lrtest ncurses newdemo picsmap rain savescreen tclock testcurs worm xmas
 curs_set_sp			test: sp_tinfo
-curscr				test: demo_panels knight lrtest ncurses popup_msg savescreen tclock view
-curses_version			test: ncurses progs: infocmp tabs tic toe tput tset
+curscr				test: demo_panels knight lrtest ncurses popup_msg savescreen tclock
+curses_version			test: ncurses progs: clear infocmp tabs tic toe tput tset
 def_prog_mode			test: bs ncurses
 def_prog_mode_sp		test: sp_tinfo
 def_shell_mode			-
@@ -310,16 +310,16 @@ delay_output_sp			test: sp_tinfo
 delch				-
 deleteln			test: insdelln
 delscreen			test: ditto dots_mvcur
-delwin				test: cardfile chgat clip_printw demo_forms demo_panels inch_wide inchs ins_wide insdelln inserts ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+delwin				test: cardfile chgat clip_printw demo_forms demo_panels inch_wide inchs ins_wide insdelln inserts ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view
 derwin				test: cardfile chgat clip_printw demo_forms demo_menus ditto inch_wide inchs ins_wide insdelln inserts movewindow ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
-doupdate			test: cardfile demo_menus demo_panels ditto ins_wide inserts knight movewindow ncurses popup_msg redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr
+doupdate			test: cardfile demo_menus demo_panels ditto ins_wide inserts knight movewindow ncurses padview popup_msg redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr
 doupdate_sp			lib: ncurses
 dupwin				test: popup_msg
 echo				test: bs hanoi ncurses test_get_wstr test_getstr testcurs testscanw
 echo_sp				lib: ncurses
 echo_wchar			test: ncurses
 echochar			test: echochar ncurses
-endwin				test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto dots_curses dots_mvcur echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses newdemo picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+endwin				test: background blue bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto dots_curses dots_mvcur dots_xcurses echochar extended_color filter firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses newdemo padview picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
 endwin_sp			lib: ncurses
 erase				test: cardfile demo_menus filter firework firstlast hanoi lrtest ncurses picsmap tclock test_opaque testcurs
 erasechar			test: ncurses
@@ -351,11 +351,11 @@ getbegy				test: chgat clip_printw demo_menus demo_panels insdelln movewindow nc
 getbkgd				test: ncurses
 getbkgrnd			test: ncurses
 getcchar			test: ncurses savescreen view
-getch				test: background blue bs chgat color_set demo_altkeys demo_new_pair extended_color filter firework firstlast foldkeys hanoi hashtest insdelln lrtest savescreen tclock test_opaque testaddch testcurs view xmas
-getcurx				test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels extended_color filter firstlast foldkeys insdelln movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs
-getcury				test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels extended_color filter firstlast foldkeys insdelln movewindow ncurses popup_msg redraw savescreen test_opaque testcurs
-getmaxx				test: chgat clip_printw demo_panels inch_wide inchs insdelln movewindow ncurses newdemo popup_msg redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
-getmaxy				test: chgat clip_printw demo_forms demo_panels inch_wide inchs insdelln movewindow ncurses newdemo popup_msg redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+getch				test: background blue bs chgat color_set demo_altkeys demo_new_pair extended_color filter firework firstlast foldkeys hanoi hashtest insdelln lrtest padview picsmap savescreen tclock test_opaque testaddch testcurs view xmas
+getcurx				test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels extended_color filter firstlast foldkeys insdelln movewindow ncurses redraw savescreen test_get_wstr test_getstr test_opaque testcurs view
+getcury				test: bs chgat clip_printw demo_altkeys demo_defkey demo_panels extended_color filter firstlast foldkeys insdelln movewindow ncurses popup_msg redraw savescreen test_opaque testcurs view
+getmaxx				test: chgat clip_printw demo_panels firstlast inch_wide inchs insdelln movewindow ncurses newdemo popup_msg redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
+getmaxy				test: chgat clip_printw demo_forms demo_panels firstlast inch_wide inchs insdelln movewindow ncurses newdemo popup_msg redraw test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
 getmouse			test: bs demo_menus knight movewindow ncurses testcurs
 getmouse_sp			-
 getn_wstr			test: test_get_wstr
@@ -365,9 +365,9 @@ getpary				test: movewindow
 getstr				test: test_getstr
 getwin				test: ncurses
 getwin_sp			-
-halfdelay			test: view
+halfdelay			test: padview view
 halfdelay_sp			test: sp_tinfo
-has_colors			test: background bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
+has_colors			test: background bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
 has_colors_sp			lib: ncurses
 has_ic				test: lrtest ncurses
 has_ic_sp			test: sp_tinfo
@@ -380,7 +380,7 @@ has_mouse_sp			-
 hline				test: gdc ncurses
 hline_set			-
 idcok				test: test_opaque
-idlok				test: ncurses test_opaque testscanw view
+idlok				test: ncurses padview test_opaque testscanw view
 immedok				test: test_opaque
 in_wch				test: inch_wide
 in_wchnstr			test: inch_wide
@@ -394,9 +394,9 @@ init_extended_color		test: extended_color
 init_extended_color_sp		test: extended_color
 init_extended_pair		test: extended_color picsmap
 init_extended_pair_sp		test: extended_color
-init_pair			test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+init_pair			test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses echochar filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
 init_pair_sp			-
-initscr				test: background blue bs cardfile chgat clip_printw color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels dots_curses echochar filter firework firstlast form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
+initscr				test: background blue bs cardfile chgat clip_printw color_set demo_defkey demo_forms demo_keyok demo_menus demo_panels dots_curses dots_xcurses echochar filter firework firstlast form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testaddch testcurs testscanw view worm xmas
 innstr				test: test_instr
 innwstr				test: test_inwstr
 ins_nwstr			test: ins_wide
@@ -434,11 +434,11 @@ key_defined_sp			test: sp_tinfo
 key_name			test: key_names ncurses
 keybound			test: demo_altkeys demo_defkey
 keybound_sp			test: sp_tinfo
-keyname				test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses redraw test_getstr testcurs view progs: tic
+keyname				test: demo_altkeys demo_defkey demo_keyok demo_menus edit_field foldkeys keynames movewindow ncurses padview redraw test_getstr testcurs view progs: tic
 keyname_sp			test: sp_tinfo
 keyok				test: demo_keyok foldkeys
 keyok_sp			test: sp_tinfo
-keypad				test: bs cardfile chgat clip_printw demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto filter firework foldkeys form_driver_w hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
+keypad				test: bs cardfile chgat clip_printw demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto filter firework foldkeys form_driver_w hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses padview popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view
 killchar			test: ncurses
 killchar_sp			test: sp_tinfo
 killwchar			test: ncurses
@@ -453,7 +453,7 @@ mouseinterval			-
 mouseinterval_sp		-
 mousemask			test: bs demo_forms demo_menus knight movewindow ncurses testcurs
 mousemask_sp			-
-move				test: blue bs cardfile chgat demo_altkeys demo_menus demo_new_pair dots_curses echochar filter foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testscanw view xmas
+move				test: blue bs cardfile chgat demo_altkeys demo_menus demo_new_pair dots_curses dots_xcurses echochar filter foldkeys gdc hanoi hashtest inch_wide inchs ins_wide inserts knight lrtest movewindow ncurses picsmap savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testscanw view xmas
 mvadd_wch			test: ncurses test_add_wchstr test_addwstr
 mvadd_wchnstr			test: test_add_wchstr
 mvadd_wchstr			test: test_add_wchstr
@@ -471,7 +471,7 @@ mvdelch				-
 mvderwin			test: movewindow
 mvget_wch			-
 mvget_wstr			test: test_get_wstr
-mvgetch				test: picsmap
+mvgetch				-
 mvgetn_wstr			test: test_get_wstr
 mvgetnstr			test: test_getstr
 mvgetstr			test: test_getstr
@@ -493,7 +493,7 @@ mvinsnstr			test: inserts
 mvinsstr			test: inserts
 mvinstr				test: test_instr
 mvinwstr			test: test_inwstr
-mvprintw			test: background bs firework form_driver_w hanoi ncurses savescreen tclock view
+mvprintw			test: background bs firework form_driver_w hanoi ncurses padview savescreen tclock view
 mvscanw				-
 mvvline				test: ncurses
 mvvline_set			test: ncurses
@@ -538,26 +538,26 @@ mvwprintw			test: demo_menus demo_panels inch_wide inchs ncurses test_instr test
 mvwscanw			test: testcurs
 mvwvline			test: ins_wide inserts movewindow test_add_wchstr test_addchstr test_addstr test_addwstr
 mvwvline_set			-
-napms				test: demo_panels ditto dots dots_curses dots_mvcur echochar extended_color firework gdc hanoi lrtest ncurses railroad rain tclock test_opaque testcurs view worm xmas progs: tset
+napms				test: demo_panels ditto dots dots_curses dots_mvcur dots_xcurses echochar extended_color firework firstlast gdc hanoi lrtest ncurses padview picsmap railroad rain tclock test_opaque testcurs view worm xmas progs: tset
 napms_sp			test: sp_tinfo
 new_prescr			test: sp_tinfo
-newpad				test: ncurses popup_msg testcurs
+newpad				test: ncurses padview popup_msg testcurs
 newpad_sp			lib: ncurses
 newscr				lib: ncurses
-newterm				test: demo_altkeys demo_new_pair ditto dots_mvcur extended_color filter foldkeys gdc key_names keynames redraw test_termattrs
+newterm				test: demo_altkeys demo_new_pair ditto dots_mvcur extended_color filter foldkeys gdc key_names keynames redraw test_setupterm test_termattrs
 newterm_sp			-
-newwin				test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs xmas
+newwin				test: cardfile chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels ditto firstlast inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view xmas
 newwin_sp			lib: ncurses
 nl				test: demo_forms ncurses rain testcurs
 nl_sp				lib: ncurses
 nocbreak			test: testcurs
 nocbreak_sp			test: sp_tinfo
-nodelay				test: demo_new_pair ditto extended_color firework gdc lrtest ncurses newdemo rain tclock test_opaque view worm xmas
-noecho				test: background bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
+nodelay				test: demo_new_pair ditto extended_color firework gdc lrtest ncurses newdemo padview rain tclock test_opaque view worm xmas
+noecho				test: background bs cardfile chgat clip_printw color_set demo_altkeys demo_defkey demo_forms demo_keyok demo_menus demo_new_pair demo_panels ditto extended_color firework firstlast foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts knight lrtest movewindow ncurses padview picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm xmas
 noecho_sp			lib: ncurses
 nofilter			-
 nofilter_sp			-
-nonl				test: bs demo_forms hashtest movewindow ncurses view worm xmas
+nonl				test: bs demo_forms hashtest movewindow ncurses padview view worm xmas
 nonl_sp				lib: ncurses
 noqiflush			-
 noqiflush_sp			test: sp_tinfo
@@ -574,7 +574,7 @@ pair_content			test: background color_set
 pair_content_sp			lib: ncurses
 pecho_wchar			-
 pechochar			-
-pnoutrefresh			test: ncurses popup_msg
+pnoutrefresh			test: ncurses padview popup_msg
 prefresh			test: testcurs
 printw				test: background blue bs color_set demo_altkeys demo_defkey demo_keyok extended_color filter foldkeys ncurses savescreen testcurs testscanw view
 putp				test: filter test_sgr progs: tput
@@ -584,19 +584,21 @@ qiflush				-
 qiflush_sp			test: sp_tinfo
 raw				test: demo_forms ncurses redraw testcurs
 raw_sp				test: sp_tinfo
-redrawwin			test: redraw view
-refresh				test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels dots_curses echochar filter firstlast form_driver_w gdc hanoi hashtest lrtest movewindow ncurses savescreen tclock testcurs view xmas
+redrawwin			test: padview redraw view
+refresh				test: blue bs demo_defkey demo_forms demo_keyok demo_menus demo_panels dots_curses dots_mvcur dots_xcurses echochar filter firstlast form_driver_w gdc hanoi hashtest lrtest movewindow ncurses picsmap savescreen tclock testcurs view xmas
+reset_color_pairs		test: picsmap
+reset_color_pairs_sp		-
 reset_prog_mode			test: filter ncurses
 reset_prog_mode_sp		test: sp_tinfo
-reset_shell_mode		test: bs filter savescreen
+reset_shell_mode		test: bs filter savescreen test_setupterm
 reset_shell_mode_sp		test: sp_tinfo
 resetty				-
 resetty_sp			test: sp_tinfo
-resize_term			test: view
+resize_term			-
 resize_term_sp			-
 resizeterm			-
 resizeterm_sp			lib: ncurses
-restartterm			-
+restartterm			test: test_setupterm
 restartterm_sp			-
 ripoffline			test: demo_menus ncurses
 ripoffline_sp			-
@@ -620,7 +622,7 @@ set_escdelay_sp			lib: ncurses
 set_tabsize			test: test_opaque
 set_tabsize_sp			test: sp_tinfo
 set_term			lib: ncurses
-setcchar			test: demo_new_pair demo_panels ins_wide ncurses picsmap test_add_wchstr test_addwstr view
+setcchar			test: demo_new_pair demo_panels ins_wide ncurses picsmap test_add_wchstr test_addwstr
 setscrreg			test: view
 setupterm			test: demo_terminfo dots list_keys sp_tinfo test_setupterm test_sgr test_termattrs test_vid_puts test_vidputs progs: clear tabs tput tset
 slk_attr			-
@@ -656,9 +658,9 @@ slk_touch_sp			lib: ncurses
 slk_wset			test: ncurses
 standend			test: blue gdc ncurses
 standout			test: blue ncurses
-start_color			test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
+start_color			test: background blue bs cardfile chgat clip_printw color_set demo_forms demo_menus demo_new_pair demo_panels dots_curses dots_xcurses echochar extended_color filter firework gdc hanoi ins_wide insdelln inserts knight ncurses newdemo padview picsmap rain savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testaddch testcurs view worm xmas
 start_color_sp			-
-stdscr				test: bs chgat clip_printw demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
+stdscr				test: bs chgat clip_printw demo_altkeys demo_forms demo_menus demo_new_pair demo_panels ditto edit_field extended_color filter firework foldkeys form_driver_w gdc hanoi hashtest inch_wide inchs ins_wide insdelln inserts key_names keynames knight lrtest movewindow ncurses padview picsmap rain redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs testscanw view worm xmas
 strcodes			test: demo_termcap test_arrays progs: dump_entry
 strfnames			test: demo_terminfo list_keys test_arrays progs: dump_entry
 strnames			test: demo_terminfo foldkeys list_keys test_arrays progs: dump_entry infocmp tic
@@ -682,7 +684,7 @@ tgetstr_sp			test: sp_tinfo
 tgoto				test: dots_termcap railroad progs: tic
 tigetflag			test: demo_terminfo progs: tic tput
 tigetflag_sp			test: sp_tinfo
-tigetnum			test: demo_terminfo ncurses progs: tput
+tigetnum			test: demo_terminfo dots dots_mvcur ncurses progs: tput
 tigetnum_sp			test: sp_tinfo
 tigetstr			test: blue demo_defkey demo_new_pair demo_terminfo foldkeys list_keys test_sgr testcurs progs: clear_cmd tput
 tigetstr_sp			test: sp_tinfo
@@ -693,7 +695,7 @@ touchwin			test: chgat clip_printw demo_menus filter firstlast inch_wide inchs i
 tparm				test: dots dots_mvcur test_sgr progs: reset_cmd tabs tic tput
 tputs				test: dots dots_mvcur dots_termcap railroad test_vid_puts test_vidputs progs: clear_cmd reset_cmd tabs
 tputs_sp			test: sp_tinfo
-trace				test: demo_menus hashtest lrtest ncurses redraw test_sgr test_termattrs test_vid_puts test_vidputs testcurs view worm
+trace				test: demo_menus hashtest lrtest ncurses padview redraw test_sgr test_termattrs test_vid_puts test_vidputs testcurs view worm
 ttytype				test: demo_terminfo test_sgr
 typeahead			test: testcurs
 typeahead_sp			test: sp_tinfo
@@ -706,15 +708,15 @@ ungetch_sp			lib: ncurses
 ungetmouse			lib: menu
 ungetmouse_sp			-
 untouchwin			lib: form
-use_default_colors		test: background filter firework gdc hanoi knight ncurses rain tclock worm xmas
+use_default_colors		test: background dots_curses dots_xcurses filter firework gdc hanoi knight ncurses rain tclock worm xmas
 use_default_colors_sp		-
-use_env				test: ncurses progs: tput
+use_env				test: dots dots_curses dots_mvcur dots_xcurses ncurses progs: clear tput
 use_env_sp			test: sp_tinfo
 use_extended_names		test: demo_termcap demo_terminfo list_keys progs: infocmp tic
 use_legacy_coding		-
 use_legacy_coding_sp		-
 use_screen			test: ditto
-use_tioctl			test: ncurses
+use_tioctl			test: ncurses progs: clear tput
 use_tioctl_sp			test: sp_tinfo
 use_window			test: rain worm
 vid_attr			test: test_vid_puts
@@ -734,21 +736,21 @@ vwscanw				lib: ncurses
 wadd_wch			test: inch_wide ncurses test_add_wchstr test_addwstr
 wadd_wchnstr			test: savescreen test_add_wchstr
 wadd_wchstr			test: test_add_wchstr
-waddch				test: demo_forms demo_panels ditto firstlast inch_wide inchs knight ncurses popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque worm
+waddch				test: demo_forms demo_panels ditto firstlast inch_wide inchs knight ncurses padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque view worm
 waddchnstr			test: test_addchstr
 waddchstr			test: test_addchstr
 waddnstr			test: demo_forms test_addstr
 waddnwstr			test: ncurses test_addwstr
 waddstr				test: chgat clip_printw demo_forms demo_panels firstlast ins_wide insdelln knight ncurses popup_msg redraw test_add_wchstr test_addstr test_addwstr testcurs
-waddwstr			test: ins_wide ncurses test_add_wchstr test_addwstr test_get_wstr
+waddwstr			test: ins_wide ncurses padview test_add_wchstr test_addwstr test_get_wstr view
 wattr_get			test: ncurses
 wattr_off			lib: ncurses
 wattr_on			lib: ncurses
 wattr_set			test: ncurses
 wattroff			test: demo_forms ncurses testcurs xmas
 wattron				test: testcurs xmas
-wattrset			test: clip_printw demo_forms insdelln ncurses newdemo test_get_wstr test_getstr testcurs xmas
-wbkgd				test: cardfile demo_forms demo_menus ncurses newdemo testcurs
+wattrset			test: clip_printw demo_forms insdelln ncurses newdemo padview test_get_wstr test_getstr testcurs xmas
+wbkgd				test: cardfile demo_forms demo_menus ncurses newdemo padview testcurs
 wbkgdset			test: demo_panels ins_wide inserts ncurses test_add_wchstr test_addchstr test_addstr test_addwstr
 wbkgrnd				lib: ncurses
 wbkgrndset			lib: ncurses
@@ -765,7 +767,7 @@ wdeleteln			test: insdelln testcurs
 wecho_wchar			lib: ncurses
 wechochar			lib: ncurses
 wenclose			test: ncurses
-werase				test: cardfile demo_forms demo_menus demo_panels firstlast knight ncurses newdemo popup_msg test_get_wstr test_getstr test_opaque testcurs xmas
+werase				test: cardfile demo_forms demo_menus demo_panels firstlast knight ncurses newdemo popup_msg test_get_wstr test_getstr test_opaque testcurs view xmas
 wget_wch			test: ins_wide ncurses test_add_wchstr test_addwstr
 wget_wstr			test: test_get_wstr
 wgetbkgrnd			lib: ncurses
@@ -779,7 +781,7 @@ wgetstr				test: test_getstr
 whline				test: testcurs
 whline_set			lib: ncurses
 win_wch				test: inch_wide savescreen
-win_wchnstr			test: inch_wide
+win_wchnstr			test: inch_wide view
 win_wchstr			test: inch_wide
 winch				test: inchs knight testcurs
 winchnstr			test: inchs
@@ -797,11 +799,11 @@ winsstr				test: inserts
 winstr				test: test_instr
 winwstr				test: test_inwstr
 wmouse_trafo			test: ncurses
-wmove				test: chgat clip_printw demo_altkeys demo_defkey demo_keyok demo_menus demo_panels extended_color firstlast foldkeys inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs worm
-wnoutrefresh			test: demo_menus ditto inch_wide inchs ins_wide inserts knight movewindow ncurses popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
+wmove				test: chgat clip_printw demo_altkeys demo_defkey demo_keyok demo_menus demo_panels extended_color firstlast foldkeys inch_wide inchs ins_wide insdelln inserts knight movewindow ncurses newdemo padview picsmap redraw savescreen test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs view worm
+wnoutrefresh			test: demo_menus ditto inch_wide inchs ins_wide inserts knight movewindow ncurses padview popup_msg redraw test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque
 wprintw				test: chgat clip_printw demo_defkey demo_forms demo_keyok demo_menus demo_panels inch_wide inchs ins_wide insdelln inserts knight ncurses test_add_wchstr test_addchstr test_addstr test_addwstr test_get_wstr test_getstr test_instr test_inwstr test_opaque testcurs
 wredrawln			test: redraw
-wrefresh			test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels firstlast ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs view worm xmas
+wrefresh			test: chgat clip_printw demo_forms demo_keyok demo_menus demo_panels firstlast ins_wide insdelln inserts knight lrtest movewindow ncurses newdemo popup_msg redraw savescreen tclock test_add_wchstr test_addchstr test_addstr test_addwstr testcurs worm xmas
 wresize				test: cardfile demo_menus ncurses
 wscanw				test: testcurs
 wscrl				test: ncurses testcurs
@@ -838,4 +840,4 @@ top_panel			test: cardfile demo_panels ncurses
 update_panels			test: cardfile demo_panels ncurses
 update_panels_sp		-
 
--- vile:txtmode
+--- vile:txtmode
diff --git a/test/dots.c b/test/dots.c
index 5490bcfb..8e500094 100644
--- a/test/dots.c
+++ b/test/dots.c
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey  1999
  *
- * $Id: dots.c,v 1.31 2017/10/22 00:44:06 tom Exp $
+ * $Id: dots.c,v 1.32 2017/10/22 15:20:57 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -97,7 +97,7 @@ ranf(void)
 }
 
 static int
-get_number(const char *cap, int map)
+get_number(NCURSES_CONST char *cap, int map)
 {
     int result = map;
     if (cap != 0) {
diff --git a/test/dots_curses.c b/test/dots_curses.c
index b0adfe18..a93fd9bb 100644
--- a/test/dots_curses.c
+++ b/test/dots_curses.c
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_curses.c,v 1.9 2017/10/22 00:44:39 tom Exp $
+ * $Id: dots_curses.c,v 1.10 2017/10/23 08:42:40 tom Exp $
  *
  * A simple demo of the curses interface used for comparison with termcap.
  */
@@ -131,9 +131,11 @@ main(int argc, char *argv[])
 	    d_option = TRUE;
 	    break;
 #endif
+#if HAVE_USE_ENV
 	case 'e':
 	    use_env(TRUE);
 	    break;
+#endif
 	case 'm':
 	    m_option = atoi(optarg);
 	    break;
diff --git a/test/dots_mvcur.c b/test/dots_mvcur.c
index 2a2cdf54..78b54dc7 100644
--- a/test/dots_mvcur.c
+++ b/test/dots_mvcur.c
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey - 2007
  *
- * $Id: dots_mvcur.c,v 1.17 2017/10/22 00:44:39 tom Exp $
+ * $Id: dots_mvcur.c,v 1.18 2017/10/22 15:22:43 tom Exp $
  *
  * A simple demo of the terminfo interface, and mvcur.
  */
@@ -98,7 +98,7 @@ ranf(void)
 }
 
 static int
-get_number(const char *cap, int map)
+get_number(NCURSES_CONST char *cap, int map)
 {
     int result = map;
     if (cap != 0) {
diff --git a/test/dots_termcap.c b/test/dots_termcap.c
index e9c34bac..b0b016c8 100644
--- a/test/dots_termcap.c
+++ b/test/dots_termcap.c
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_termcap.c,v 1.15 2017/10/22 00:49:45 tom Exp $
+ * $Id: dots_termcap.c,v 1.16 2017/10/22 15:21:34 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -60,7 +60,7 @@ static char *t_ve;
 static char *t_vi;
 
 static struct {
-    const char *name;
+    NCURSES_CONST char *name;
     char **value;
 } my_caps[] = {
 
@@ -164,7 +164,7 @@ my_napms(int ms)
 }
 
 static int
-get_number(const char *cap, const char *env)
+get_number(NCURSES_CONST char *cap, const char *env)
 {
     int result = tgetnum(cap);
     char *value = env ? getenv(env) : 0;
diff --git a/test/modules b/test/modules
index 938acf06..7dde8b2e 100644
--- a/test/modules
+++ b/test/modules
@@ -1,4 +1,4 @@
-# $Id: modules,v 1.65 2017/10/11 08:08:41 tom Exp $
+# $Id: modules,v 1.66 2017/10/22 16:06:33 tom Exp $
 ##############################################################################
 # Copyright (c) 1998-2016,2017 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -78,6 +78,7 @@ lrtest		progs		$(srcdir)	$(HEADER_DEPS)
 movewindow	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/popup_msg.h
 ncurses		progs		$(srcdir)	$(HEADER_DEPS)	../include/panel.h ../include/menu.h ../include/form.h
 newdemo		progs		$(srcdir)	$(HEADER_DEPS)
+padview		progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/widechars.h	$(srcdir)/popup_msg.h
 picsmap		progs		$(srcdir)	$(HEADER_DEPS)
 popup_msg	progs		$(srcdir)	$(HEADER_DEPS)	$(srcdir)/popup_msg.h
 railroad	progs		$(srcdir)	$(HEADER_DEPS)
diff --git a/test/ncurses.c b/test/ncurses.c
index 12717880..a01b6fac 100644
--- a/test/ncurses.c
+++ b/test/ncurses.c
@@ -40,7 +40,7 @@ AUTHOR
    Author: Eric S. Raymond  1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.470 2017/10/20 21:20:47 tom Exp $
+$Id: ncurses.c,v 1.487 2017/10/28 00:54:41 tom Exp $
 
 ***************************************************************************/
 
@@ -476,6 +476,7 @@ Cannot(const char *what)
 {
     printw("\nThis %s terminal %s\n\n", getenv("TERM"), what);
     Pause();
+    endwin();
 }
 
 static void
@@ -2263,16 +2264,16 @@ color_test(bool recur GCC_UNUSED)
 
     while (!done) {
 	int shown = 0;
+	double colors_max2 = (double) colors_max * (double) colors_max;
 
 	pairs_max = PAIR_NUMBER(A_COLOR) + 1;
-	if (colors_max * colors_max <= COLOR_PAIRS) {
+	if (colors_max2 <= COLOR_PAIRS) {
 	    int limit = (colors_max - MinColors) * (colors_max - MinColors);
 	    if (pairs_max > limit)
 		pairs_max = limit;
-	} else {
-	    if (pairs_max > COLOR_PAIRS)
-		pairs_max = COLOR_PAIRS;
 	}
+	if (pairs_max < COLOR_PAIRS)
+	    pairs_max = COLOR_PAIRS;
 
 	/* this assumes an 80-column line */
 	if (opt_wide) {
@@ -2491,16 +2492,16 @@ x_color_test(bool recur GCC_UNUSED)
 
     while (!done) {
 	int shown = 0;
+	double colors_max2 = (double) colors_max * (double) colors_max;
 
-	pairs_max = (unsigned short) (-1);
-	if (colors_max * colors_max <= COLOR_PAIRS) {
+	pairs_max = ((unsigned) (-1)) / 2;
+	if (colors_max2 <= COLOR_PAIRS) {
 	    int limit = (colors_max - MinColors) * (colors_max - MinColors);
 	    if (pairs_max > limit)
 		pairs_max = limit;
-	} else {
-	    if (pairs_max > COLOR_PAIRS)
-		pairs_max = COLOR_PAIRS;
 	}
+	if (pairs_max > COLOR_PAIRS)
+	    pairs_max = COLOR_PAIRS;
 
 	if (opt_wide) {
 	    width = 4;
@@ -6656,6 +6657,44 @@ form_test(bool recur GCC_UNUSED)
  ****************************************************************************/
 
 #if HAVE_COPYWIN		/* ...and overlay, overwrite */
+
+static WINDOW *
+make_overlap(int n)
+{
+    WINDOW *result;
+    int y, x;
+
+    getmaxyx(stdscr, y, x);
+    if (y < 23 || x < 80) {
+	Cannot("The screen is too small for this test");
+	result = 0;
+    } else {
+	const int H_SIZE = 1;	/* header-size */
+	const int F_SIZE = 6;	/* footer-size */
+	int ymax = y - (H_SIZE + F_SIZE);
+	int high = ymax / 5;	/* equal-sized parts for cross */
+	int xmax = x - 2;	/* margin */
+	int wide = (xmax / 5) & ~1;
+	int lmar, tmar;
+
+	if (high > 8)
+	    high = 8;
+
+	if (wide > 8)
+	    wide = 8;
+
+	tmar = (ymax - (5 * high)) / 2 + H_SIZE;
+	lmar = (xmax - (5 * wide)) / 2;
+
+	if (n == 0) {
+	    result = newwin(3 * high, 3 * wide, tmar, lmar);
+	} else {
+	    result = newwin(3 * high, 3 * wide, tmar + 2 * high, lmar + 2 * wide);
+	}
+    }
+    return result;
+}
+
 static void
 fillwin(WINDOW *win, char ch)
 {
@@ -6670,24 +6709,107 @@ fillwin(WINDOW *win, char ch)
     }
 }
 
+#define InCross(x,y, x1,y1) \
+	    (((x > (x1 - 1) / 3) && (x <= (2 * (x1 - 1)) / 3)) \
+		|| (((y > (y1 - 1) / 3) && (y <= (2 * (y1 - 1)) / 3))))
+
 static void
 crosswin(WINDOW *win, char ch)
 {
     int y, x;
     int y1, x1;
+    int xw = 1;
 
     getmaxyx(win, y1, x1);
     for (y = 0; y < y1; y++) {
-	for (x = 0; x < x1; x++)
-	    if (((x > (x1 - 1) / 3) && (x <= (2 * (x1 - 1)) / 3))
-		|| (((y > (y1 - 1) / 3) && (y <= (2 * (y1 - 1)) / 3)))) {
+	for (x = 0; x < x1; x += xw) {
+	    if (InCross(x, y, x1, y1)) {
 		wmove(win, y, x);
 		waddch(win, UChar(ch));
 	    }
+	}
     }
 }
 
-#define OVERLAP_FLAVORS 5
+/*
+ * Match "crosswin()", but using line-drawing characters.  This could be done
+ * a little simpler using box(), but the reason for this example is to test
+ * hline/vline and addch with line-drawing vs the copy/overlay functions.
+ */
+static void
+crossbox(WINDOW *win)
+{
+    int y1, x1;
+    int ymax, xmax;
+
+    getmaxyx(win, y1, x1);
+
+    ymax = (y1 + 1);
+    xmax = (x1 + 1);
+
+    mvwhline(win, 0, (xmax / 3), ACS_HLINE, (xmax / 3));
+    mvwhline(win, ymax / 3, 0, ACS_HLINE, xmax);
+    mvwhline(win, ((2 * ymax) / 3) - 1, 0, ACS_HLINE, xmax);
+    mvwhline(win, y1 - 1, (xmax / 3), ACS_HLINE, (xmax / 3));
+
+    mvwvline(win, (ymax / 3), 0, ACS_VLINE, (ymax / 3));
+    mvwvline(win, 0, xmax / 3, ACS_VLINE, ymax);
+    mvwvline(win, 0, ((2 * xmax) / 3) - 1, ACS_VLINE, ymax);
+    mvwvline(win, (ymax / 3), x1 - 1, ACS_VLINE, (ymax / 3));
+
+    mvwaddch(win, 0, (xmax / 3), ACS_ULCORNER);
+    mvwaddch(win, 0, ((2 * xmax) / 3) - 1, ACS_URCORNER);
+    mvwaddch(win, y1 - 1, (xmax / 3), ACS_LLCORNER);
+    mvwaddch(win, y1 - 1, ((2 * xmax) / 3) - 1, ACS_LRCORNER);
+
+    mvwaddch(win, (ymax / 3), 0, ACS_ULCORNER);
+    mvwaddch(win, ((2 * ymax) / 3) - 1, 0, ACS_LLCORNER);
+    mvwaddch(win, (ymax / 3), x1 - 1, ACS_URCORNER);
+    mvwaddch(win, ((2 * ymax) / 3) - 1, x1 - 1, ACS_LRCORNER);
+
+    mvwaddch(win, (ymax / 3), (xmax / 3), ACS_PLUS);
+    mvwaddch(win, (ymax / 3), ((2 * xmax) / 3) - 1, ACS_PLUS);
+    mvwaddch(win, ((2 * ymax) / 3) - 1, ((2 * xmax) / 3) - 1, ACS_PLUS);
+    mvwaddch(win, ((2 * ymax) / 3) - 1, (xmax / 3), ACS_PLUS);
+}
+
+typedef enum {
+    otBASE_refresh = 0
+    ,otBASE_fill
+    ,otBASE_draw
+    ,otBASE_clear
+    ,otBASE_copy
+} otBASE;
+
+#define OVERLAP_FLAVORS 6
+
+typedef enum {
+    otFILL_normal = 0
+    ,otFILL_bold
+    ,otFILL_color
+    ,otFILL_bright
+} otFILL;
+
+#define LimitFILL() UseColors ? 4 : 2
+
+typedef enum {
+    otDRAW_text_cross = 0
+    ,otDRAW_line_box
+    ,otDRAW_line_cross
+    ,otDRAW_set_bg
+    ,otDRAW_reset_bg
+} otDRAW;
+
+#define LimitDRAW() UseColors ? 5 : 3
+
+typedef enum {
+    otCOPY_overwrite = 0
+    ,otCOPY_merge
+    ,otCOPY_force
+    ,otCOPY_overlay
+} otCOPY;
+
+#define LimitCOPY() 4
 
 static void
 overlap_helpitem(int state, int item, char *message)
@@ -6705,18 +6827,18 @@ overlap_test_1_attr(WINDOW *win, int flavor, int col)
 {
     NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (1 + (flavor * 2) + col);
 
-    switch (flavor) {
-    case 0:
+    switch ((otFILL) flavor) {
+    case otFILL_normal:
 	(void) wattrset(win, A_NORMAL);
 	break;
-    case 1:
+    case otFILL_bold:
 	(void) wattrset(win, A_BOLD);
 	break;
-    case 2:
+    case otFILL_color:
 	init_pair(cpair, COLOR_BLUE, COLOR_WHITE);
 	(void) wattrset(win, AttrArg(COLOR_PAIR(cpair), A_NORMAL));
 	break;
-    case 3:
+    case otFILL_bright:
 	init_pair(cpair, COLOR_WHITE, COLOR_BLUE);
 	(void) wattrset(win, AttrArg(COLOR_PAIR(cpair), A_BOLD));
 	break;
@@ -6728,18 +6850,21 @@ overlap_test_2_attr(WINDOW *win, int flavor, int col)
 {
     NCURSES_PAIRS_T cpair = (NCURSES_PAIRS_T) (9 + (flavor * 2) + col);
 
-    switch (flavor) {
-    case 0:
+    switch ((otDRAW) flavor) {
+    case otDRAW_text_cross:
 	/* no effect */
 	break;
-    case 1:
+    case otDRAW_line_box:
 	/* no effect */
 	break;
-    case 2:
+    case otDRAW_line_cross:
+	/* no effect */
+	break;
+    case otDRAW_set_bg:
 	init_pair(cpair, COLOR_RED, COLOR_GREEN);
 	wbkgdset(win, colored_chtype(' ', A_BLINK, cpair));
 	break;
-    case 3:
+    case otDRAW_reset_bg:
 	wbkgdset(win, ' ' | A_NORMAL);
 	break;
     }
@@ -6751,6 +6876,7 @@ overlap_help(int state, int flavors[OVERLAP_FLAVORS])
     int row;
     int col;
     int item;
+    int limit[OVERLAP_FLAVORS];
     const char *ths, *tht;
     char msg[80];
 
@@ -6765,68 +6891,69 @@ overlap_help(int state, int flavors[OVERLAP_FLAVORS])
 	ths = col ? "B" : "A";
 	tht = col ? "A" : "B";
 
-	switch (row) {
-	case 0:
+	switch ((otBASE) row) {
+	case otBASE_refresh:
+	    limit[row] = 1;
 	    flavors[row] = 0;
 	    _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			"refresh %s, then %s, then doupdate.", ths, tht);
 	    break;
-	case 1:
-	    if (UseColors) {
-		flavors[row] %= 4;
-	    } else {
-		flavors[row] %= 2;
-	    }
+	case otBASE_fill:
+	    limit[row] = LimitFILL();
+	    flavors[row] %= limit[row];
 	    overlap_test_1_attr(stdscr, flavors[row], col);
 	    _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			"fill window %s with letter %s.", ths, ths);
 	    break;
-	case 2:
-	    if (UseColors) {
-		flavors[row] %= 4;
-	    } else {
-		flavors[row] %= 2;
-	    }
-	    switch (flavors[row]) {
-	    case 0:
+	case otBASE_draw:
+	    limit[row] = LimitDRAW();
+	    flavors[row] %= limit[row];
+	    switch ((otDRAW) flavors[row]) {
+	    case otDRAW_text_cross:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
-			    "cross pattern in window %s.", ths);
+			    "cross text-pattern in window %s.", ths);
 		break;
-	    case 1:
+	    case otDRAW_line_box:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
-			    "draw box in window %s.", ths);
+			    "draw line-box in window %s.", ths);
 		break;
-	    case 2:
+	    case otDRAW_line_cross:
+		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
+			    "draw line-cross in window %s.", ths);
+		break;
+	    case otDRAW_set_bg:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			    "set background of window %s.", ths);
 		break;
-	    case 3:
+	    case otDRAW_reset_bg:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			    "reset background of window %s.", ths);
 		break;
 	    }
 	    break;
-	case 3:
+	case otBASE_clear:
+	    limit[row] = 1;
 	    flavors[row] = 0;
 	    _nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			"clear window %s.", ths);
 	    break;
-	case 4:
-	    flavors[row] %= 4;
-	    switch (flavors[row]) {
-	    case 0:
+	case otBASE_copy:
+	    limit[row] = LimitCOPY();
+	    flavors[row] %= limit[row];
+	    switch ((otCOPY) flavors[row]) {
+	    case otCOPY_overwrite:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			    "overwrite %s onto %s.", ths, tht);
 		break;
-	    case 1:
+	    case otCOPY_merge:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			    "copywin(FALSE) %s onto %s.", ths, tht);
 		break;
-	    case 2:
+	    case otCOPY_force:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			    "copywin(TRUE) %s onto %s.", ths, tht);
 		break;
-	    case 3:
+	    case otCOPY_overlay:
 		_nc_SPRINTF(msg, _nc_SLIMIT(sizeof(msg))
 			    "overlay %s onto %s.", ths, tht);
 		break;
@@ -6838,8 +6965,12 @@ overlap_help(int state, int flavors[OVERLAP_FLAVORS])
 	wbkgdset(stdscr, ' ' | A_NORMAL);
     }
     move(LINES - 1, 0);
-    printw("^Q/ESC = terminate test.  Up/down/space select test variations (%d %d).",
-	   state, flavors[state]);
+    printw("^Q/ESC = terminate test.  Up/down/space select tests (row %d",
+	   state + 1);
+    if (limit[state] > 1)
+	printw(" test %d:%d", 1 + flavors[state], limit[state]);
+    printw(").");
+    clrtoeol();
 
     return state;
 }
@@ -6866,17 +6997,20 @@ static void
 overlap_test_2(int flavor, int col, WINDOW *a, char fill)
 {
     overlap_test_2_attr(a, flavor, col);
-    switch (flavor) {
-    case 0:
+    switch ((otDRAW) flavor) {
+    case otDRAW_text_cross:
 	crosswin(a, fill);
 	break;
-    case 1:
+    case otDRAW_line_box:
 	box(a, 0, 0);
 	break;
-    case 2:
+    case otDRAW_line_cross:
+	crossbox(a);
+	break;
+    case otDRAW_set_bg:
 	/* done in overlap_test_2_attr */
 	break;
-    case 3:
+    case otDRAW_reset_bg:
 	/* done in overlap_test_2_attr */
 	break;
     }
@@ -6892,17 +7026,17 @@ overlap_test_3(WINDOW *a)
 static void
 overlap_test_4(int flavor, WINDOW *a, WINDOW *b)
 {
-    switch (flavor) {
-    case 0:
+    switch ((otCOPY) flavor) {
+    case otCOPY_overwrite:
 	overwrite(a, b);
 	break;
-    case 1:
+    case otCOPY_merge:
 	copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), FALSE);
 	break;
-    case 2:
+    case otCOPY_force:
 	copywin(a, b, 0, 0, 0, 0, getmaxy(b), getmaxx(b), TRUE);
 	break;
-    case 3:
+    case otCOPY_overlay:
 	overlay(a, b);
 	break;
     }
@@ -6912,24 +7046,186 @@ overlap_test_4(int flavor, WINDOW *a, WINDOW *b)
 static int
 overlap_test(bool recur GCC_UNUSED)
 {
+    WINDOW *win1, *win2;
+    int ch;
+    int state, flavor[OVERLAP_FLAVORS];
+
+    if ((win1 = make_overlap(0)) == 0
+	|| (win2 = make_overlap(1)) == 0)
+	return ERR;
+
+    curs_set(0);
+    raw();
+    refresh();
+    move(0, 0);
+    printw("Test wnoutrefresh() for two overlapping windows:");
+
+    memset(flavor, 0, sizeof(flavor));
+    state = overlap_help(0, flavor);
+
+    while (!isQuit(ch = Getchar(), TRUE)) {
+	switch (ch) {
+	case 'a':		/* refresh window A first, then B */
+	    overlap_test_0(win1, win2);
+	    break;
+
+	case 'b':		/* refresh window B first, then A */
+	    overlap_test_0(win2, win1);
+	    break;
+
+	case 'c':		/* fill window A so it's visible */
+	    overlap_test_1(flavor[otBASE_fill], 0, win1, 'A');
+	    break;
+
+	case 'd':		/* fill window B so it's visible */
+	    overlap_test_1(flavor[otBASE_fill], 1, win2, 'B');
+	    break;
+
+	case 'e':		/* cross test pattern in window A */
+	    overlap_test_2(flavor[otBASE_draw], 0, win1, 'A');
+	    break;
+
+	case 'f':		/* cross test pattern in window A */
+	    overlap_test_2(flavor[otBASE_draw], 1, win2, 'B');
+	    break;
+
+	case 'g':		/* clear window A */
+	    overlap_test_3(win1);
+	    break;
+
+	case 'h':		/* clear window B */
+	    overlap_test_3(win2);
+	    break;
+
+	case 'i':		/* overwrite A onto B */
+	    overlap_test_4(flavor[otBASE_copy], win1, win2);
+	    break;
+
+	case 'j':		/* overwrite B onto A */
+	    overlap_test_4(flavor[otBASE_copy], win2, win1);
+	    break;
+
+	case CTRL('n'):
+	case KEY_DOWN:
+	    state = overlap_help(state + 1, flavor);
+	    break;
+
+	case CTRL('p'):
+	case KEY_UP:
+	    state = overlap_help(state - 1, flavor);
+	    break;
+
+	case ' ':
+	    flavor[state] += 1;
+	    state = overlap_help(state, flavor);
+	    break;
+
+	case HELP_KEY_1:
+	    state = overlap_help(state, flavor);
+	    break;
+
+	default:
+	    beep();
+	    break;
+	}
+    }
+
+    delwin(win2);
+    delwin(win1);
+    erase();
+    exit_curses();
+    return OK;
+}
+
+#if USE_WIDEC_SUPPORT
+static void
+x_fillwin(WINDOW *win, wchar_t ch)
+{
+    int y, x;
+    int y1, x1;
+
+    getmaxyx(win, y1, x1);
+    x1 /= 2;
+    for (y = 0; y < y1; y++) {
+	wmove(win, y, 0);
+	for (x = 0; x < x1; x++)
+	    waddnwstr(win, &ch, 1);
+    }
+}
+
+static void
+x_crosswin(WINDOW *win, wchar_t ch)
+{
+    int y, x;
+    int y1, x1;
+    int xw = 2;
+
+    getmaxyx(win, y1, x1);
+    for (y = 0; y < y1; y++) {
+	for (x = 0; x < x1; x += xw) {
+	    if (InCross(x, y, x1, y1)) {
+		wmove(win, y, x);
+		waddnwstr(win, &ch, 1);
+	    }
+	}
+    }
+}
+
+static void
+x_overlap_test_1(int flavor, int col, WINDOW *a, wchar_t fill)
+{
+    overlap_test_1_attr(a, flavor, col);
+    x_fillwin(a, fill);
+    (void) wattrset(a, A_NORMAL);
+}
+
+static void
+x_overlap_test_2(int flavor, int col, WINDOW *a, wchar_t fill)
+{
+    overlap_test_2_attr(a, flavor, col);
+    switch ((otDRAW) flavor) {
+    case otDRAW_text_cross:
+	x_crosswin(a, fill);
+	break;
+    case otDRAW_line_box:
+	box(a, 0, 0);
+	break;
+    case otDRAW_line_cross:
+	crossbox(a);
+	break;
+    case otDRAW_set_bg:
+	/* done in overlap_test_2_attr */
+	break;
+    case otDRAW_reset_bg:
+	/* done in overlap_test_2_attr */
+	break;
+    }
+}
+
+/* test effects of overlapping windows */
+static int
+x_overlap_test(bool recur GCC_UNUSED)
+{
+    const wchar_t WIDE_A = 0xff21;
+    const wchar_t WIDE_B = 0xff22;
+    WINDOW *win1, *win2;
     int ch;
     int state, flavor[OVERLAP_FLAVORS];
 
-    WINDOW *win1 = newwin(9, 20, 3, 3);
-    WINDOW *win2 = newwin(9, 20, 9, 16);
+    if ((win1 = make_overlap(0)) == 0
+	|| (win2 = make_overlap(1)) == 0)
+	return ERR;
 
     curs_set(0);
     raw();
     refresh();
     move(0, 0);
-    printw("This test shows the behavior of wnoutrefresh() with respect to\n");
-    printw("the shared region of two overlapping windows A and B.  The cross\n");
-    printw("pattern in each window does not overlap the other.\n");
+    printw("Test wnoutrefresh() for overlapping windows with double-cell characters:");
 
     memset(flavor, 0, sizeof(flavor));
     state = overlap_help(0, flavor);
 
-    while (!isQuit(ch = Getchar(), TRUE))
+    while (!isQuit(ch = Getchar(), TRUE)) {
 	switch (ch) {
 	case 'a':		/* refresh window A first, then B */
 	    overlap_test_0(win1, win2);
@@ -6940,19 +7236,19 @@ overlap_test(bool recur GCC_UNUSED)
 	    break;
 
 	case 'c':		/* fill window A so it's visible */
-	    overlap_test_1(flavor[1], 0, win1, 'A');
+	    x_overlap_test_1(flavor[otBASE_fill], 0, win1, WIDE_A);
 	    break;
 
 	case 'd':		/* fill window B so it's visible */
-	    overlap_test_1(flavor[1], 1, win2, 'B');
+	    x_overlap_test_1(flavor[otBASE_fill], 1, win2, WIDE_B);
 	    break;
 
 	case 'e':		/* cross test pattern in window A */
-	    overlap_test_2(flavor[2], 0, win1, 'A');
+	    x_overlap_test_2(flavor[otBASE_draw], 0, win1, WIDE_A);
 	    break;
 
 	case 'f':		/* cross test pattern in window A */
-	    overlap_test_2(flavor[2], 1, win2, 'B');
+	    x_overlap_test_2(flavor[otBASE_draw], 1, win2, WIDE_B);
 	    break;
 
 	case 'g':		/* clear window A */
@@ -6964,11 +7260,11 @@ overlap_test(bool recur GCC_UNUSED)
 	    break;
 
 	case 'i':		/* overwrite A onto B */
-	    overlap_test_4(flavor[4], win1, win2);
+	    overlap_test_4(flavor[otBASE_copy], win1, win2);
 	    break;
 
 	case 'j':		/* overwrite B onto A */
-	    overlap_test_4(flavor[4], win2, win1);
+	    overlap_test_4(flavor[otBASE_copy], win2, win1);
 	    break;
 
 	case CTRL('n'):
@@ -6994,6 +7290,7 @@ overlap_test(bool recur GCC_UNUSED)
 	    beep();
 	    break;
 	}
+    }
 
     delwin(win2);
     delwin(win1);
@@ -7001,6 +7298,7 @@ overlap_test(bool recur GCC_UNUSED)
     exit_curses();
     return OK;
 }
+#endif /* USE_WIDEC_SUPPORT */
 
 #endif /* HAVE_COPYWIN */
 
@@ -7240,7 +7538,7 @@ main_menu(bool top)
 	CMDS(TRUE, ONLY(form_test),	'r', "exercise form library"),
 #endif
 #if HAVE_COPYWIN
-	CMDS(TRUE, ONLY(overlap_test),	's', "overlapping-refresh test"),
+	CMDS(TRUE, BOTH(overlap_test),	's', "overlapping-refresh test"),
 #endif
 #if USE_LIBMENU && defined(TRACE)
 	CMDS(TRUE, ONLY(trace_set),	't', "set trace level"),
diff --git a/test/padview.c b/test/padview.c
new file mode 100644
index 00000000..3b4e052a
--- /dev/null
+++ b/test/padview.c
@@ -0,0 +1,524 @@
+/****************************************************************************
+ * Copyright (c) 2017 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            *
+ * "Software"), to deal in the Software without restriction, including      *
+ * without limitation the rights to use, copy, modify, merge, publish,      *
+ * distribute, distribute with modifications, sublicense, and/or sell       *
+ * copies of the Software, and to permit persons to whom the Software is    *
+ * furnished to do so, subject to the following conditions:                 *
+ *                                                                          *
+ * The above copyright notice and this permission notice shall be included  *
+ * in all copies or substantial portions of the Software.                   *
+ *                                                                          *
+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
+ *                                                                          *
+ * Except as contained in this notice, the name(s) of the above copyright   *
+ * holders shall not be used in advertising or otherwise to promote the     *
+ * sale, use or other dealings in this Software without prior written       *
+ * authorization.                                                           *
+ ****************************************************************************/
+/*
+ * clone of view.c, using pads
+ *
+ * $Id: padview.c,v 1.12 2017/10/23 00:37:21 tom Exp $
+ */
+
+#include 
+#include 
+#include 
+
+#include 
+#include 
+
+#if HAVE_NEWPAD
+
+static void finish(int sig) GCC_NORETURN;
+
+#define my_pair 1
+
+static int shift = 0;
+static bool try_color = FALSE;
+
+static char *fname;
+static int num_lines;
+
+#if USE_WIDEC_SUPPORT
+static bool n_option = FALSE;
+#endif
+
+static void usage(void) GCC_NORETURN;
+
+static void
+failed(const char *msg)
+{
+    endwin();
+    fprintf(stderr, "%s\n", msg);
+    ExitProgram(EXIT_FAILURE);
+}
+
+static void
+finish(int sig)
+{
+    endwin();
+    ExitProgram(sig != 0 ? EXIT_FAILURE : EXIT_SUCCESS);
+}
+
+static void
+show_all(const char *tag, WINDOW *my_pad, int my_row)
+{
+    int i;
+    int digits;
+    char temp[BUFSIZ];
+    time_t this_time;
+
+    for (digits = 1, i = num_lines; i > 0; i /= 10) {
+	++digits;
+    }
+
+    wattrset(stdscr, COLOR_PAIR(my_pair));
+    clear();
+
+    _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
+		"view %.*s", (int) strlen(tag), tag);
+    i = (int) strlen(temp);
+    _nc_SPRINTF(temp + i, _nc_SLIMIT(sizeof(temp) - i)
+		" %.*s", (int) sizeof(temp) - i - 2, fname);
+    mvprintw(0, 0, "%.*s", COLS, temp);
+    this_time = time((time_t *) 0);
+    _nc_STRNCPY(temp, ctime(&this_time), (size_t) 30);
+    if ((i = (int) strlen(temp)) != 0) {
+	temp[--i] = 0;
+	mvprintw(0, COLS - i - 2, "  %s", temp);
+    }
+
+    for (i = 1; i < LINES; i++) {
+	int actual = my_row + i;
+	if (actual > num_lines) {
+	    break;
+	}
+	mvprintw(i, 0, "%*d:", digits, actual);
+    }
+    wnoutrefresh(stdscr);
+    pnoutrefresh(my_pad, my_row, shift, 1, digits + 1, LINES - 1, COLS - 1);
+    doupdate();
+}
+
+static WINDOW *
+read_file(const char *filename)
+{
+    FILE *fp;
+    int pass;
+    int k;
+    int height, width;
+    size_t j;
+    size_t len;
+    struct stat sb;
+    char *my_blob;
+    char **my_vec = 0;
+    WINDOW *my_pad;
+
+    if (stat(filename, &sb) != 0
+	|| (sb.st_mode & S_IFMT) != S_IFREG) {
+	failed("input is not a file");
+    }
+
+    if (sb.st_size == 0) {
+	failed("input is empty");
+    }
+
+    if ((fp = fopen(filename, "r")) == 0) {
+	failed("cannot open input-file");
+    }
+
+    if ((my_blob = malloc((size_t) sb.st_size + 1)) == 0) {
+	failed("cannot allocate memory for input-file");
+    }
+
+    len = fread(my_blob, sizeof(char), (size_t) sb.st_size, fp);
+    my_blob[sb.st_size] = '\0';
+    fclose(fp);
+
+    for (pass = 0; pass < 2; ++pass) {
+	char *base = my_blob;
+	k = 0;
+	for (j = 0; j < len; ++j) {
+	    if (my_blob[j] == '\n') {
+		if (pass) {
+		    my_vec[k] = base;
+		    my_blob[j] = '\0';
+		}
+		base = my_blob + j + 1;
+		++k;
+	    }
+	}
+	num_lines = k;
+	if (base != (my_blob + j))
+	    ++num_lines;
+	if (!pass &&
+	    ((my_vec = typeCalloc(char *, (size_t) k + 2)) == 0)) {
+	    failed("cannot allocate line-vector #1");
+	}
+    }
+
+#if USE_WIDEC_SUPPORT
+    if (!memcmp("\357\273\277", my_blob, 3)) {
+	char *s = my_blob + 3;
+	char *d = my_blob;
+	Trace(("trim BOM"));
+	do {
+	} while ((*d++ = *s++) != '\0');
+    }
+#endif
+
+    height = num_lines;
+    width = (int) strlen(my_vec[0]);
+    for (k = 1; my_vec[k]; ++k) {
+	int check = (int) (my_vec[k] - my_vec[k - 1]);
+	if (width < check)
+	    width = check;
+    }
+    width = (width + 1) * 5;
+    my_pad = newpad(height, width);
+    if (my_pad == 0)
+	failed("cannot allocate pad workspace");
+    if (try_color) {
+	wattrset(my_pad, COLOR_PAIR(my_pair));
+	wbkgd(my_pad, (chtype) COLOR_PAIR(my_pair));
+    }
+
+    /*
+     * Use the curses library for rendering, including tab-conversion.
+     */
+    Trace(("slurp the file"));
+    for (k = 0; my_vec[k]; ++k) {
+	char *s;
+#if USE_WIDEC_SUPPORT
+	char *last = my_vec[k] + (int) strlen(my_vec[k]);
+	wchar_t wch[2];
+	size_t rc;
+#ifndef state_unused
+	mbstate_t state;
+#endif
+#endif /* USE_WIDEC_SUPPORT */
+
+	wmove(my_pad, k, 0);
+#if USE_WIDEC_SUPPORT
+	wch[1] = 0;
+	reset_mbytes(state);
+#endif
+	for (s = my_vec[k]; *s != '\0'; ++s) {
+#if USE_WIDEC_SUPPORT
+	    if (!n_option) {
+		rc = (size_t) check_mbytes(wch[0], s, (size_t) (last - s), state);
+		if ((long) rc == -1 || (long) rc == -2) {
+		    break;
+		}
+		s += rc - 1;
+		waddwstr(my_pad, wch);
+	    } else
+#endif
+		waddch(my_pad, *s & 0xff);
+	}
+    }
+
+    free(my_vec);
+    free(my_blob);
+
+    return my_pad;
+}
+
+static void
+usage(void)
+{
+    static const char *msg[] =
+    {
+	"Usage: view [options] file"
+	,""
+	,"Options:"
+	," -c       use color if terminal supports it"
+	," -i       ignore INT, QUIT, TERM signals"
+#if USE_WIDEC_SUPPORT
+	," -n       use waddch (bytes) rather then wadd_wch (wide-chars)"
+#endif
+	," -s       start in single-step mode, waiting for input"
+#ifdef TRACE
+	," -t       trace screen updates"
+	," -T NUM   specify trace mask"
+#endif
+    };
+    size_t n;
+    for (n = 0; n < SIZEOF(msg); n++)
+	fprintf(stderr, "%s\n", msg[n]);
+    ExitProgram(EXIT_FAILURE);
+}
+
+int
+main(int argc, char *argv[])
+{
+    static const char *help[] =
+    {
+	"Commands:",
+	"  q,^Q,ESC       - quit this program",
+	"",
+	"  p,         - scroll the viewport up by one row",
+	"  n,       - scroll the viewport down by one row",
+	"  l,       - scroll the viewport left by one column",
+	"  r,      - scroll the viewport right by one column",
+	"  <,>            - scroll the viewport left/right by 8 columns",
+	"",
+	"  h,       - scroll the viewport to top of file",
+	"  ^F,    - scroll to the next page",
+	"  ^B,    - scroll to the previous page",
+	"  e,        - scroll the viewport to end of file",
+	"",
+	"  ^L             - repaint using redrawwin()",
+	"",
+	"  0 through 9    - enter digits for count",
+	"  s              - use entered count for halfdelay() parameter",
+	"                 - if no entered count, stop nodelay()",
+	"          - begin nodelay()",
+	0
+    };
+
+    int i;
+    int my_delay = 0;
+    WINDOW *my_pad;
+    int my_row = 0;
+    int value = 0;
+    bool done = FALSE;
+    bool got_number = FALSE;
+    bool ignore_sigs = FALSE;
+    bool single_step = FALSE;
+    const char *my_label = "Input";
+
+    setlocale(LC_ALL, "");
+
+    while ((i = getopt(argc, argv, "cinstT:")) != -1) {
+	switch (i) {
+	case 'c':
+	    try_color = TRUE;
+	    break;
+	case 'i':
+	    ignore_sigs = TRUE;
+	    break;
+#if USE_WIDEC_SUPPORT
+	case 'n':
+	    n_option = TRUE;
+	    break;
+#endif
+	case 's':
+	    single_step = TRUE;
+	    break;
+#ifdef TRACE
+	case 'T':
+	    {
+		char *next = 0;
+		int tvalue = (int) strtol(optarg, &next, 0);
+		if (tvalue < 0 || (next != 0 && *next != 0))
+		    usage();
+		trace((unsigned) tvalue);
+	    }
+	    break;
+	case 't':
+	    trace(TRACE_CALLS);
+	    break;
+#endif
+	default:
+	    usage();
+	}
+    }
+    if (optind + 1 != argc)
+	usage();
+
+    InitAndCatch(initscr(), ignore_sigs ? SIG_IGN : finish);
+    keypad(stdscr, TRUE);	/* enable keyboard mapping */
+    (void) nonl();		/* tell curses not to do NL->CR/NL on output */
+    (void) cbreak();		/* take input chars one at a time, no wait for \n */
+    (void) noecho();		/* don't echo input */
+    if (!single_step)
+	nodelay(stdscr, TRUE);
+    idlok(stdscr, TRUE);	/* allow use of insert/delete line */
+
+    my_pad = read_file(fname = argv[optind]);
+
+    if (try_color) {
+	if (has_colors()) {
+	    start_color();
+	    init_pair(my_pair, COLOR_WHITE, COLOR_BLUE);
+	    bkgd((chtype) COLOR_PAIR(my_pair));
+	} else {
+	    try_color = FALSE;
+	}
+    }
+
+    my_row = 0;
+    while (!done) {
+	int n, c;
+
+	if (!got_number)
+	    show_all(my_label, my_pad, my_row);
+
+	for (;;) {
+	    c = getch();
+	    if ((c < 127) && isdigit(c)) {
+		if (!got_number) {
+		    MvPrintw(0, 0, "Count: ");
+		    clrtoeol();
+		}
+		addch(UChar(c));
+		value = 10 * value + (c - '0');
+		got_number = TRUE;
+	    } else
+		break;
+	}
+	if (got_number && value) {
+	    n = value;
+	} else {
+	    n = 1;
+	}
+
+	if (c != ERR)
+	    my_label = keyname(c);
+	switch (c) {
+	case KEY_DOWN:
+	case 'n':
+	    for (i = 0; i < n; i++)
+		if (my_row < (num_lines - LINES + 1))
+		    my_row++;
+		else
+		    break;
+	    break;
+
+	case KEY_UP:
+	case 'p':
+	    for (i = 0; i < n; i++)
+		if (my_row > 0)
+		    my_row--;
+		else
+		    break;
+	    break;
+
+	case 'h':
+	    /* FALLTHRU */
+	case KEY_HOME:
+	    my_row = 0;
+	    break;
+
+	case '<':
+	    if ((shift -= 8) < 0)
+		shift = 0;
+	    break;
+	case '>':
+	    shift += 8;
+	    break;
+
+	case 'e':
+	    /* FALLTHRU */
+	case KEY_END:
+	    if (num_lines > LINES)
+		my_row = (num_lines - LINES + 1);
+	    else
+		my_row = (num_lines - 2);
+	    break;
+
+	case CTRL('F'):
+	    /* FALLTHRU */
+	case KEY_NPAGE:
+	    for (i = 0; i < n; i++) {
+		if (my_row < (num_lines - 5))
+		    my_row += (LINES - 1);
+		else
+		    my_row = (num_lines - 2);
+	    }
+	    break;
+
+	case CTRL('B'):
+	    /* FALLTHRU */
+	case KEY_PPAGE:
+	    for (i = 0; i < n; i++) {
+		if (my_row >= LINES)
+		    my_row -= (LINES - 1);
+		else
+		    my_row = 0;
+	    }
+	    break;
+
+	case 'r':
+	case KEY_RIGHT:
+	    shift += n;
+	    break;
+
+	case 'l':
+	case KEY_LEFT:
+	    shift -= n;
+	    if (shift < 0) {
+		shift = 0;
+		beep();
+	    }
+	    break;
+
+	case 'q':
+	case QUIT:
+	case ESCAPE:
+	    done = TRUE;
+	    break;
+
+#ifdef KEY_RESIZE
+	case KEY_RESIZE:	/* ignore this; ncurses will repaint */
+	    break;
+#endif
+	case 's':
+#if HAVE_HALFDELAY
+	    if (got_number) {
+		halfdelay(my_delay = n);
+	    } else {
+		nodelay(stdscr, FALSE);
+		my_delay = -1;
+	    }
+#else
+	    nodelay(stdscr, FALSE);
+	    my_delay = -1;
+#endif
+	    break;
+	case ' ':
+	    nodelay(stdscr, TRUE);
+	    my_delay = 0;
+	    break;
+	case CTRL('L'):
+	    redrawwin(stdscr);
+	    break;
+	case ERR:
+	    if (!my_delay)
+		napms(50);
+	    break;
+	case HELP_KEY_1:
+	    popup_msg(stdscr, help);
+	    break;
+	default:
+	    beep();
+	    break;
+	}
+	if (c >= KEY_MIN || (c > 0 && !isdigit(c))) {
+	    got_number = FALSE;
+	    value = 0;
+	}
+    }
+
+    finish(0);			/* we're done */
+}
+#else
+int
+main(void)
+{
+    printf("This program requires the curses pad functions\n");
+    ExitProgram(EXIT_FAILURE);
+}
+#endif
diff --git a/test/programs b/test/programs
index 76b7c3b3..4c57ef56 100644
--- a/test/programs
+++ b/test/programs
@@ -1,4 +1,4 @@
-# $Id: programs,v 1.40 2017/10/11 08:08:41 tom Exp $
+# $Id: programs,v 1.41 2017/10/22 16:06:57 tom Exp $
 ##############################################################################
 # Copyright (c) 2006-2016,2017 Free Software Foundation, Inc.                #
 #                                                                            #
@@ -74,6 +74,7 @@ list_keys	$(LDFLAGS_TINFO)	$(LOCAL_LIBS)	list_keys
 lrtest		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	lrtest
 movewindow	$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	movewindow popup_msg
 ncurses		$(LDFLAGS_DEFAULT)	$(LOCAL_LIBS)	ncurses
+padview		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	padview popup_msg
 picsmap		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	picsmap
 newdemo		$(LDFLAGS_CURSES)	$(LOCAL_LIBS)	newdemo
 railroad	$(LDFLAGS_TINFO)	$(LOCAL_LIBS)	railroad
diff --git a/test/view.c b/test/view.c
index aa06a3e8..bf4377f4 100644
--- a/test/view.c
+++ b/test/view.c
@@ -51,7 +51,7 @@
  * scroll operation worked, and the refresh() code only had to do a
  * partial repaint.
  *
- * $Id: view.c,v 1.129 2017/10/22 00:49:23 tom Exp $
+ * $Id: view.c,v 1.135 2017/10/23 09:18:01 tom Exp $
  */
 
 #include 
@@ -61,15 +61,10 @@
 #include 
 #include 
 
-#undef CTRL			/* conflict on AIX 5.2 with  */
-
 static void finish(int sig) GCC_NORETURN;
 
 #define my_pair 1
 
-#undef CTRL
-#define CTRL(x)	((x) & 0x1f)
-
 static int shift = 0;
 static bool try_color = FALSE;
 
@@ -138,10 +133,15 @@ static void
 show_all(const char *tag)
 {
     int i;
+    int digits;
     char temp[BUFSIZ];
     NCURSES_CH_T *s;
     time_t this_time;
 
+    for (digits = 1, i = num_lines; i > 0; i /= 10) {
+	++digits;
+    }
+
     _nc_SPRINTF(temp, _nc_SLIMIT(sizeof(temp))
 		"view %.*s", (int) strlen(tag), tag);
     i = (int) strlen(temp);
@@ -173,7 +173,7 @@ show_all(const char *tag)
 	    break;
 	}
 	move(i, 0);
-	printw("%3d:", actual);
+	printw("%*d:", digits, actual);
 	clrtoeol();
 	if ((s = lptr[i - 1]) == 0) {
 	    continue;
@@ -282,7 +282,7 @@ read_file(const char *filename)
     }
 
 #if USE_WIDEC_SUPPORT
-    if (!memcmp("", my_blob, 3)) {
+    if (!memcmp("\357\273\277", my_blob, 3)) {
 	char *s = my_blob + 3;
 	char *d = my_blob;
 	Trace(("trim BOM"));
@@ -347,7 +347,8 @@ read_file(const char *filename)
 	if (y)
 	    x = width - 1;
 	wmove(my_win, 0, 0);
-	if ((vec_lines[k] = typeCalloc(NCURSES_CH_T, (size_t) x + 1)) == 0)
+	/* "x + 1" works with standard curses; some implementations are buggy */
+	if ((vec_lines[k] = typeCalloc(NCURSES_CH_T, x + width + 1)) == 0)
 	    failed("cannot allocate line-vector #3");
 #if USE_WIDEC_SUPPORT
 	win_wchnstr(my_win, vec_lines[k], x);
@@ -398,6 +399,7 @@ main(int argc, char *argv[])
 	"  n,       - scroll the viewport down by one row",
 	"  l,       - scroll the viewport left by one column",
 	"  r,      - scroll the viewport right by one column",
+	"  <,>            - scroll the viewport left/right by 8 columns",
 	"",
 	"  h,       - scroll the viewport to top of file",
 	"  ^F,    - scroll to the next page",
@@ -425,7 +427,7 @@ main(int argc, char *argv[])
 
     setlocale(LC_ALL, "");
 
-    while ((i = getopt(argc, argv, "cirstT:")) != -1) {
+    while ((i = getopt(argc, argv, "cinstT:")) != -1) {
 	switch (i) {
 	case 'c':
 	    try_color = TRUE;
@@ -433,6 +435,11 @@ main(int argc, char *argv[])
 	case 'i':
 	    ignore_sigs = TRUE;
 	    break;
+#if USE_WIDEC_SUPPORT
+	case 'n':
+	    n_option = TRUE;
+	    break;
+#endif
 	case 's':
 	    single_step = TRUE;
 	    break;
@@ -529,18 +536,20 @@ main(int argc, char *argv[])
 	    scrl((int) (lptr - olptr));
 	    break;
 
-	case '<':
-	    shift = 0;
-	    /* FALLTHRU */
 	case 'h':
 	    /* FALLTHRU */
 	case KEY_HOME:
 	    lptr = vec_lines;
 	    break;
 
+	case '<':
+	    if ((shift -= 8) < 0)
+		shift = 0;
+	    break;
 	case '>':
-	    shift = 0;
-	    /* FALLTHRU */
+	    shift += 8;
+	    break;
+
 	case 'e':
 	    /* FALLTHRU */
 	case KEY_END: