Changeset 82f3b2b for patches


Ignore:
Timestamp:
Jan 27, 2009, 5:02:11 PM (15 years ago)
Author:
Jim Gifford <clfs@…>
Branches:
clfs-1.2, clfs-2.1, clfs-3.0.0-systemd, clfs-3.0.0-sysvinit, master, systemd, sysvinit
Children:
983210a
Parents:
d309e2e
Message:

Updated Ncurses Branch Update Patch to -6

File:
1 moved

Legend:

Unmodified
Added
Removed
  • patches/ncurses-5.7-branch_update-6.patch

    rd309e2e r82f3b2b  
    11Submitted By: Jim Gifford (jim at cross-lfs dot org)
    2 Date: 01-18-2009
     2Date: 01-27-2009
    33Initial Package Version: 5.7
    44Origin: Upstream
    55Upstream Status: Applied
    66Description: This is a branch update for NCurses-5.7, and should be
    7              rechecked periodically. This patch covers up to 5.7-20090117.
     7             rechecked periodically. This patch covers up to 5.7-20090124.
    88
    9 diff -Naur ncurses-5.7.orig/Ada95/gen/Makefile.in ncurses-5.7/Ada95/gen/Makefile.in
    10 --- ncurses-5.7.orig/Ada95/gen/Makefile.in      2008-10-04 15:58:31.000000000 -0700
    11 +++ ncurses-5.7/Ada95/gen/Makefile.in   2009-01-18 23:56:40.000000000 -0800
    12 @@ -1,5 +1,5 @@
    13  ##############################################################################
    14 -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.                #
    15 +# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
    16  #                                                                            #
    17  # Permission is hereby granted, free of charge, to any person obtaining a    #
    18  # copy of this software and associated documentation files (the "Software"), #
    19 @@ -28,7 +28,7 @@
    20  #
    21  #  Author:  Juergen Pfeifer, 1996
    22  #
    23 -#  $Id: Makefile.in,v 1.61 2008/10/04 22:58:31 tom Exp $
    24 +#  $Id: Makefile.in,v 1.63 2009/01/11 01:11:35 tom Exp $
    25  #
    26  .SUFFIXES:
    27  
    28 @@ -81,7 +81,7 @@
    29  M4             = m4
    30  M4FLAGS                = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
    31  
    32 -ADACURSES_CONFIG = adacurses-config
    33 +ADACURSES_CONFIG = adacurses@DFT_ARG_SUFFIX@-config
    34  
    35  WRAPPER                = sh $(top_srcdir)/misc/shlib
    36  GENERATE       = ./gen$x '@DFT_ARG_SUFFIX@'
    37 @@ -166,6 +166,7 @@
    38  
    39  sources:
    40  
    41 +$(DESTDIR)$(bindir) \
    42  $(ADA_INCLUDE) \
    43  $(ADA_OBJECTS) :
    44         sh $(top_srcdir)/mkdirs.sh $@
    45 @@ -187,8 +188,8 @@
    46         @-chmod u+x $(ADA_SRCDIR)/*.ali
    47  
    48  install \
    49 -install.libs :: $(DESTDIR)$(bindir) adacurses-config
    50 -       $(INSTALL_PROG) adacurses-config $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
    51 +install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
    52 +       $(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
    53  
    54  uninstall \
    55  uninstall.libs ::
    56 @@ -398,7 +399,7 @@
    57         -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
    58  
    59  distclean :: clean
    60 -       -rm -f adacurses-config
    61 +       -rm -f $(ADACURSES_CONFIG)
    62         -rm -f Makefile
    63  
    64  realclean :: distclean
    65 diff -Naur ncurses-5.7.orig/Ada95/gen/adacurses-config.in ncurses-5.7/Ada95/gen/adacurses-config.in
    66 --- ncurses-5.7.orig/Ada95/gen/adacurses-config.in      2007-04-07 14:06:50.000000000 -0700
    67 +++ ncurses-5.7/Ada95/gen/adacurses-config.in   2009-01-18 23:56:40.000000000 -0800
    68 @@ -1,18 +1,47 @@
    69  #! /bin/sh
    70 -# $Id: adacurses-config.in,v 1.2 2007/04/07 21:06:50 tom Exp $
    71 -#
    72 -# This script will return the option to add to `gnatmake' for using
    73 -# AdaCurses.
    74 +# $Id: adacurses-config.in,v 1.5 2009/01/11 00:08:19 tom Exp $
    75 +##############################################################################
    76 +# Copyright (c) 2007,2009 Free Software Foundation, Inc.                     #
    77 +#                                                                            #
    78 +# Permission is hereby granted, free of charge, to any person obtaining a    #
    79 +# copy of this software and associated documentation files (the "Software"), #
    80 +# to deal in the Software without restriction, including without limitation  #
    81 +# the rights to use, copy, modify, merge, publish, distribute, distribute    #
    82 +# with modifications, sublicense, and/or sell copies of the Software, and to #
    83 +# permit persons to whom the Software is furnished to do so, subject to the  #
    84 +# following conditions:                                                      #
    85 +#                                                                            #
    86 +# The above copyright notice and this permission notice shall be included in #
    87 +# all copies or substantial portions of the Software.                        #
    88 +#                                                                            #
    89 +# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
    90 +# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
    91 +# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
    92 +# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
    93 +# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
    94 +# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
    95 +# DEALINGS IN THE SOFTWARE.                                                  #
    96 +#                                                                            #
    97 +# Except as contained in this notice, the name(s) of the above copyright     #
    98 +# holders shall not be used in advertising or otherwise to promote the sale, #
    99 +# use or other dealings in this Software without prior written               #
    100 +# authorization.                                                             #
    101 +##############################################################################
    102  #
    103 +# This script returns the options to add to `gnatmake' for using AdaCurses.
    104 +
    105 +DESTDIR=@DESTDIR@
    106 +prefix=@prefix@
    107 +exec_prefix=@exec_prefix@
    108 +libdir=@libdir@
    109  
    110 -prefix="@prefix@"
    111 -exec_prefix="@exec_prefix@"
    112 -libdir="@libdir@"
    113 +ADA_INCLUDE=@ADA_INCLUDE@
    114 +ADA_OBJECTS=@ADA_OBJECTS@
    115  
    116 -VERSION="@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
    117 +VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
    118  
    119 -CFLAGS="-I$libdir/adacurses -L$libdir/adacurses"
    120 -LIBS="-L$prefix/lib -lAdaCurses"
    121 +CFLAGS="-I$ADA_INCLUDE -aO$ADA_OBJECTS"
    122 +LIBS="-L$ADA_OBJECTS -lAdaCurses"
    123  
    124  case "x$1" in
    125      x--version)
    126 @@ -26,10 +55,10 @@
    127          ;;
    128      x)
    129         # if no parameter is given, give what gnatmake needs
    130 -        echo $CFLAGS -largs $LIBS
    131 +        echo "$CFLAGS -i -largs $LIBS"
    132          ;;
    133      *)
    134 -        echo 'Usage: adacurses-config [--version | --cflags | --libs]' >&2
    135 +        echo 'Usage: adacurses@DFT_ARG_SUFFIX@-config [--version | --cflags | --libs]' >&2
    136          exit 1
    137          ;;
    138  esac
    139 diff -Naur ncurses-5.7.orig/Ada95/samples/Makefile.in ncurses-5.7/Ada95/samples/Makefile.in
    140 --- ncurses-5.7.orig/Ada95/samples/Makefile.in  2006-12-17 08:45:02.000000000 -0800
    141 +++ ncurses-5.7/Ada95/samples/Makefile.in       2009-01-18 23:56:40.000000000 -0800
    142 @@ -1,5 +1,5 @@
    143  ##############################################################################
    144 -# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.                #
    145 +# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
    146  #                                                                            #
    147  # Permission is hereby granted, free of charge, to any person obtaining a    #
    148  # copy of this software and associated documentation files (the "Software"), #
    149 @@ -28,7 +28,7 @@
    150  #
    151  #  Author:  Juergen Pfeifer, 1996
    152  #
    153 -#  $Id: Makefile.in,v 1.34 2006/12/17 16:45:02 tom Exp $
    154 +#  $Id: Makefile.in,v 1.36 2009/01/11 01:11:54 tom Exp $
    155  #
    156  .SUFFIXES:
    157  
    158 @@ -88,8 +88,8 @@
    159  
    160  CARGS        =-cargs $(ADAFLAGS)
    161  LARGS        =-largs @TEST_ARG2@ $(LD_FLAGS) -lAdaCurses
    162 -
    163 -PROGS        = tour rain ncurses
    164 +
    165 +PROGS        = tour rain ncurses
    166  
    167  TOUR_OBJS    = tour.o sample.o sample-curses_demo.o sample-explanation.o       \
    168                 sample-form_demo.o sample-function_key_setting.o                \
    169 @@ -145,7 +145,7 @@
    170  
    171  clean :: mostlyclean
    172         rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
    173 -       explain.msg trace screendump
    174 +       explain.msg trace screendump b~*.ad[bs]
    175  
    176  distclean :: clean
    177         rm -f Makefile
    178 diff -Naur ncurses-5.7.orig/Ada95/src/Makefile.in ncurses-5.7/Ada95/src/Makefile.in
    179 --- ncurses-5.7.orig/Ada95/src/Makefile.in      2007-09-15 11:22:24.000000000 -0700
    180 +++ ncurses-5.7/Ada95/src/Makefile.in   2009-01-18 23:56:40.000000000 -0800
    181 @@ -1,5 +1,5 @@
    182  ##############################################################################
    183 -# Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.                #
    184 +# Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.                #
    185  #                                                                            #
    186  # Permission is hereby granted, free of charge, to any person obtaining a    #
    187  # copy of this software and associated documentation files (the "Software"), #
    188 @@ -28,7 +28,7 @@
    189  #
    190  #  Author:  Juergen Pfeifer, 1996
    191  #
    192 -#  $Id: Makefile.in,v 1.31 2007/09/15 18:22:24 tom Exp $
    193 +#  $Id: Makefile.in,v 1.34 2009/01/11 01:11:44 tom Exp $
    194  #
    195  .SUFFIXES:
    196  
    197 @@ -36,17 +36,22 @@
    198  THIS           = Makefile
    199  
    200  MODEL          = ../../@DFT_OBJ_SUBDIR@
    201 +
    202  DESTDIR                = @DESTDIR@
    203 +
    204 +top_srcdir     = @top_srcdir@
    205  srcdir         = @srcdir@
    206  prefix         = @prefix@
    207  exec_prefix    = @exec_prefix@
    208 -ADA_INCLUDE    = @ADA_INCLUDE@
    209 +
    210 +ADA_INCLUDE    = $(DESTDIR)@ADA_INCLUDE@
    211 +ADA_OBJECTS    = $(DESTDIR)@ADA_OBJECTS@
    212  
    213  INSTALL                = @INSTALL@
    214 -INSTALL_DATA   = @INSTALL_DATA@
    215 +INSTALL_LIB    = @INSTALL@ @INSTALL_LIB@
    216  
    217  AR             = @AR@
    218 -AR_OPTS                = @AR_OPTS@
    219 +ARFLAGS                = @ARFLAGS@
    220  AWK            = @AWK@
    221  LN_S           = @LN_S@
    222  
    223 @@ -75,11 +80,12 @@
    224  ADAFLAGS        = @ADAFLAGS@ -I. -I$(srcdir)
    225  
    226  ADAMAKE         = @cf_ada_make@
    227 -ADAMAKEFLAGS    =
    228 +ADAMAKEFLAGS    =
    229  
    230  CARGS           = -cargs $(ADAFLAGS)
    231  LARGS           =
    232  
    233 +LIBRARY_FILE   = libAdaCurses.a
    234  ALIB            = @cf_ada_package@
    235  ABASE           = $(ALIB)-curses
    236  
    237 @@ -164,21 +170,25 @@
    238         $(ABASE)-text_io-complex_io.o
    239  
    240  
    241 -all ::  libAdaCurses.a
    242 +all ::  $(LIBRARY_FILE)
    243         @echo done
    244  
    245 -libAdaCurses.a :: dotouch $(LIBOBJS) @cf_generic_objects@
    246 -       $(AR) $(AR_OPTS) $@ $(LIBOBJS) @cf_generic_objects@
    247 -
    248 -dotouch :
    249 -       @sh -c 'for f in $(LIBALIS) $(GENALIS); do test -f $$f || touch $$f; done'
    250 +$(LIBRARY_FILE) :: $(LIBOBJS) @cf_generic_objects@
    251 +       $(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@
    252  
    253  sources :
    254         @echo made $@
    255  
    256  libs \
    257  install \
    258 -install.libs \
    259 +install.libs :: $(LIBRARY_FILE)
    260 +       @echo made $(LIBRARY_FILE)
    261 +
    262 +install \
    263 +install.libs :: $(LIBRARY_FILE)
    264 +       @$(top_srcdir)/tar-copy.sh $(LIBRARY_FILE) . $(ADA_OBJECTS)
    265 +       @echo made $@
    266 +
    267  uninstall \
    268  uninstall.libs ::
    269         @echo made $@
    270 diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-mouse.adb ncurses-5.7/Ada95/src/terminal_interface-curses-mouse.adb
    271 --- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-mouse.adb      2008-07-26 11:51:11.000000000 -0700
    272 +++ ncurses-5.7/Ada95/src/terminal_interface-curses-mouse.adb   2009-01-18 23:56:21.000000000 -0800
    273 @@ -35,8 +35,8 @@
    274  ------------------------------------------------------------------------------
    275  --  Author:  Juergen Pfeifer, 1996
    276  --  Version Control:
    277 ---  $Revision: 1.22 $
    278 ---  $Date: 2008/07/26 18:51:11 $
    279 +--  $Revision: 1.23 $
    280 +--  $Date: 2008/11/16 00:19:59 $
    281  --  Binding Version 01.00
    282  ------------------------------------------------------------------------------
    283  with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
    284 @@ -50,7 +50,7 @@
    285     function Has_Mouse return Boolean
    286     is
    287        function Mouse_Avail return C_Int;
    288 -      pragma Import (C, Mouse_Avail, "_nc_has_mouse");
    289 +      pragma Import (C, Mouse_Avail, "has_mouse");
    290     begin
    291        if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
    292           return True;
    293 diff -Naur ncurses-5.7.orig/INSTALL ncurses-5.7/INSTALL
    294 --- ncurses-5.7.orig/INSTALL    2008-11-02 13:13:51.000000000 -0800
    295 +++ ncurses-5.7/INSTALL 2009-01-18 23:56:34.000000000 -0800
    296 @@ -1,5 +1,5 @@
    297  -------------------------------------------------------------------------------
    298 --- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.               --
    299 +-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.               --
    300  --                                                                           --
    301  -- Permission is hereby granted, free of charge, to any person obtaining a   --
    302  -- copy of this software and associated documentation files (the             --
    303 @@ -25,7 +25,7 @@
    304  -- sale, use or other dealings in this Software without prior written        --
    305  -- authorization.                                                            --
    306  -------------------------------------------------------------------------------
    307 --- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $
    308 +-- $Id: INSTALL,v 1.137 2009/01/03 23:59:23 tom Exp $
    309  ---------------------------------------------------------------------
    310               How to install Ncurses/Terminfo on your system
    311  ---------------------------------------------------------------------
    312 @@ -525,6 +525,11 @@
    313         terminfo entries.  This is the default, unless you have disabled the
    314         extended functions.
    315  
    316 +    --enable-pc-files
    317 +       If pkg-config is found (see --with-pkg-config), generate ".pc" files
    318 +       for each of the libraries, and install them in pkg-config's library
    319 +       directory.
    320 +
    321      --enable-reentrant
    322         Compile experimental configuration which improves reentrant use of the
    323         library by reducing global and static variables.  This option is also
    324 @@ -850,6 +855,9 @@
    325         those using termcap, do not use the higher speeds.  Your application
    326         (or system, in general) may or may not.
    327  
    328 +    --with-pkg-config=[DIR]
    329 +       Check for pkg-config, optionally specifying its path.
    330 +
    331      --with-profile
    332         Generate profile-libraries These are named by adding "_p" to the root,
    333         e.g., libncurses_p.a
    334 @@ -975,6 +983,9 @@
    335      --without-dlsym
    336         Do not use dlsym() to load GPM dynamically.
    337  
    338 +    --without-manpages
    339 +       Tell the configure script to suppress the install of ncurses' manpages.
    340 +
    341      --without-progs
    342         Tell the configure script to suppress the build of ncurses' application
    343         programs (e.g., tic).  The test applications will still be built if you
    344 diff -Naur ncurses-5.7.orig/MANIFEST ncurses-5.7/MANIFEST
    345 --- ncurses-5.7.orig/MANIFEST   2008-10-25 16:47:24.000000000 -0700
    346 +++ ncurses-5.7/MANIFEST        2009-01-18 23:56:34.000000000 -0800
    347 @@ -640,6 +640,7 @@
    348  ./man/ncurses.3x
    349  ./man/panel.3x
    350  ./man/resizeterm.3x
    351 +./man/tabs.1
    352  ./man/term.5
    353  ./man/term.7
    354  ./man/terminfo.head
    355 @@ -694,6 +695,7 @@
    356  ./misc/emx.src
    357  ./misc/form.def
    358  ./misc/form.ref
    359 +./misc/gen-pkgconfig.in
    360  ./misc/gen_edit.sh
    361  ./misc/jpf-indent
    362  ./misc/makedef.cmd
    363 @@ -947,6 +949,7 @@
    364  ./progs/infocmp.c
    365  ./progs/modules
    366  ./progs/progs.priv.h
    367 +./progs/tabs.c
    368  ./progs/tic.c
    369  ./progs/toe.c
    370  ./progs/tput.c
    371 @@ -963,6 +966,7 @@
    372  ./test/cardfile.c
    373  ./test/cardfile.dat
    374  ./test/chgat.c
    375 +./test/clip_printw.c
    376  ./test/color_set.c
    377  ./test/configure
    378  ./test/configure.in
    379 @@ -990,6 +994,7 @@
    380  ./test/inch_wide.c
    381  ./test/inchs.c
    382  ./test/ins_wide.c
    383 +./test/insdelln.c
    384  ./test/inserts.c
    385  ./test/key_names.c
    386  ./test/keynames.c
    387 diff -Naur ncurses-5.7.orig/NEWS ncurses-5.7/NEWS
    388 --- ncurses-5.7.orig/NEWS       2008-11-01 17:56:22.000000000 -0700
    389 +++ ncurses-5.7/NEWS    2009-01-18 23:56:41.000000000 -0800
    390 @@ -1,5 +1,5 @@
    391  -------------------------------------------------------------------------------
    392 --- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.               --
    393 +-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.               --
    394  --                                                                           --
    395  -- Permission is hereby granted, free of charge, to any person obtaining a   --
    396  -- copy of this software and associated documentation files (the             --
    397 @@ -25,7 +25,7 @@
    398  -- sale, use or other dealings in this Software without prior written        --
    399  -- authorization.                                                            --
    400  -------------------------------------------------------------------------------
    401 --- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $
    402 +-- $Id: NEWS,v 1.1358 2009/01/17 23:54:20 tom Exp $
    403  -------------------------------------------------------------------------------
    404  
    405  This is a log of changes that ncurses has gone through since Zeyd started
    406 @@ -45,6 +45,125 @@
    407  Changes through 1.9.9e did not credit all contributions;
    408  it is not possible to add this information.
    409  
    410 +20090117
    411 +       + add -shared option to MK_SHARED_LIB when -Bsharable is used, for
    412 +         *BSD's, without which "main" might be one of the shared library's
    413 +         dependencies (report/analysis by Ken Dickey).
    414 +       + modify waddch_literal(), updating line-pointer after a multicolumn
    415 +         character is found to not fit on the current row, and wrapping is
    416 +         done.  Since the line-pointer was not updated, the wrapped
    417 +         multicolumn character was written to the beginning of the current row
    418 +         (cf: 20041023, reported by "Nick" regarding problem with ncmpc
    419 +         http://musicpd.org/mantis/bug_view_page.php?bug_id=1930).
    420 +
    421 +20090110
    422 +       + add screen.Eterm terminfo entry (GenToo #124887) -TD
    423 +       + modify adacurses-config to look for ".ali" files in the adalib
    424 +         directory.
    425 +       + correct install for Ada95, which omitted libAdaCurses.a used in
    426 +         adacurses-config
    427 +       + change install for adacurses-config to provide additional flavors
    428 +         such as adacursesw-config, for ncursesw (GenToo #167849).
    429 +
    430 +20090105
    431 +       + remove undeveloped feature in ncurses-config.in for setting
    432 +         prefix variable.
    433 +       + recent change to ncurses-config.in did not take into account the
    434 +         --disable-overwrite option, which sets $includedir to the
    435 +         subdirectory and using just that for a -I option does not work - fix
    436 +         (report by Frederic L W Meunier).
    437 +
    438 +20090104
    439 +       + modify gen-pkgconfig.in to eliminate a dependency on rpath when
    440 +         deciding whether to add $LIBS to --libs output; that should be shown
    441 +         for the ncurses and tinfo libraries without taking rpath into
    442 +         account.
    443 +       + fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk,
    444 +         used in static libraries (report by Marty Jack).
    445 +
    446 +20090103
    447 +       + add a configure-time check to pick a suitable value for
    448 +         CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen).
    449 +       + add configure --with-pkg-config and --enable-pc-files options, along
    450 +         with misc/gen-pkgconfig.in which can be used to generate ".pc" files
    451 +         for pkg-config (request by Jan Engelhardt).
    452 +       + use $includedir symbol in misc/ncurses-config.in, add --includedir
    453 +         option.
    454 +       + change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a
    455 +         configure check to detect whether a "-" is needed before "ar"
    456 +         options.
    457 +       + update config.guess, config.sub from
    458 +               http://savannah.gnu.org/projects/config
    459 +
    460 +20081227
    461 +       + modify mk-1st.awk to work with extra categories for tinfo library.
    462 +       + modify configure script to allow building shared libraries with gcc
    463 +         on AIX 5 or 6 (adapted from patch by Lital Natan).
    464 +
    465 +20081220
    466 +       + modify to omit the opaque-functions from lib_gen.o when
    467 +         --disable-ext-funcs is used.
    468 +       + add test/clip_printw.c to illustrate how to use printw without
    469 +         wrapping.
    470 +       + modify ncurses 'F' test to demo wborder_set() with colored lines.
    471 +       + modify ncurses 'f' test to demo wborder() with colored lines.
    472 +
    473 +20081213
    474 +       + add check for failure to open hashed-database needed for db4.6
    475 +         (GenToo #245370).
    476 +       + corrected --without-manpages option; previous change only suppressed
    477 +         the auxiliary rules install.man and uninstall.man
    478 +       + add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from
    479 +         GenToo #250454).
    480 +       + fixes from NetBSD port at
    481 +         http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches
    482 +         patch-ac (build-fix for DragonFly)
    483 +         patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config).
    484 +       + improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH
    485 +         by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the
    486 +         search-lists.
    487 +       + correct title string for keybound manpage (patch by Frederic Culot,
    488 +         OpenBSD documentation/6019),
    489 +
    490 +20081206
    491 +       + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to
    492 +         work for progs/clear, progs/tabs, etc.
    493 +       + correct buffer-size after internal resizing of wide-character
    494 +         set_field_buffer(), broken in 20081018 changes (report by Mike Gran).
    495 +       + add "-i" option to test/filter.c to tell it to use initscr() rather
    496 +         than newterm(), to investigate report on comp.unix.programmer that
    497 +         ncurses would clear the screen in that case (it does not - the issue
    498 +         was xterm's alternate screen feature).
    499 +       + add check in mouse-driver to disable connection if GPM returns a
    500 +         zero, indicating that the connection is closed (Debian #506717,
    501 +         adapted from patch by Samuel Thibault).
    502 +
    503 +20081129
    504 +       + improve a workaround in adding wide-characters, when a control
    505 +         character is found.  The library (cf: 20040207) uses unctrl() to
    506 +         obtain a printable version of the control character, but was not
    507 +         passing color or video attributes.
    508 +       + improve test/ncurses.c 'a' test, using unctrl() more consistently to
    509 +         display meta-characters.
    510 +       + turn on _XOPEN_CURSES definition in curses.h
    511 +       + add eterm-color entry (report by Vincent Lefevre) -TD
    512 +       + correct use of key_name() in test/ncurses.c 'A' test, which only
    513 +         displays wide-characters, not key-codes since 20070612 (report by
    514 +         Ricardo Cantu).
    515 +
    516 +20081122
    517 +       + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and
    518 +         Ada95 (patch by Juergen Pfeifer).
    519 +       + document in TO-DO an issue with Cygwin's package for GNAT (report
    520 +         by Mike Dennison).
    521 +       + improve error-checking of command-line options in "tabs" program.
    522 +
    523 +20081115
    524 +       + change several terminfo entries to make consistent use of ANSI
    525 +         clear-all-tabs -TD
    526 +       + add "tabs" program (prompted by Debian #502260).
    527 +       + add configure --without-manpages option (request by Mike Frysinger).
    528 +
    529  20081102 5.7 release for upload to ftp.gnu.org
    530  
    531  20081025
    532 diff -Naur ncurses-5.7.orig/TO-DO ncurses-5.7/TO-DO
    533 --- ncurses-5.7.orig/TO-DO      2008-10-11 12:22:27.000000000 -0700
    534 +++ ncurses-5.7/TO-DO   2009-01-18 23:56:23.000000000 -0800
    535 @@ -25,7 +25,7 @@
    536  -- sale, use or other dealings in this Software without prior written        --
    537  -- authorization.                                                            --
    538  -------------------------------------------------------------------------------
    539 --- $Id: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $
    540 +-- $Id: TO-DO,v 1.53 2008/11/28 16:39:12 tom Exp $
    541  -------------------------------------------------------------------------------
    542  
    543  SHORT-TERM TO-DO ITEMS:
    544 @@ -45,7 +45,7 @@
    545  + Scrolling optimization has holes:  for example, it forces repaints of the
    546    screen between calls to refresh().
    547  
    548 -+ SVr4 uses slightly different rules for determining when softkeys are shown.
    549 ++ SVr4 uses slightly different rules for determining when softkeys are shown.
    550    For example, they are initially displayed (before the ncurses 'e' test
    551    activates them), and a touchwin can apparently also force them to be
    552    displayed.
    553 @@ -58,7 +58,7 @@
    554  + The window classes defined in the c++ subdirectory need documentation.  Some
    555    C++ programmer could earn a lot of good karma by doing this...
    556  
    557 -+ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
    558 ++ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
    559    There appear to be no terminals that require that functionality.
    560  
    561  + the configure --disable-ext-funcs option does not work for Ada95 tree.
    562 @@ -66,6 +66,24 @@
    563  + the --with-pthread configuration builds for Cygwin, but does not work
    564    properly (test/worm.c shows all of the worms in the same location).
    565  
    566 ++ the Ada95 tree requires a small fix to build on Cygwin, since the GNAT port
    567 +  to that platform provides an incomplete Interrupts.Names package.  For
    568 +  instance (your gcc version may be different):
    569 +        /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads
    570 +
    571 +  cut here...
    572 +-------------------------------------------------------------------------------
    573 +--- a-intnam.ads.orig   2003-10-21 13:41:51.000000000 +0000
    574 ++++ a-intnam.ads        2007-05-05 22:40:02.609375000 +0000
    575 +@@ -44,5 +44,6 @@
    576 +
    577 +    DUMMY_INTERRUPT_1 : constant Interrupt_ID := 1;
    578 +    DUMMY_INTERRUPT_2 : constant Interrupt_ID := 2;
    579 ++   SIGINT : constant Interrupt_ID := 2;
    580 +
    581 + end Ada.Interrupts.Names;
    582 +-------------------------------------------------------------------------------
    583 +
    584  + the --enable-rpath configure option builds for the corresponding platforms;
    585    however combining it with --with-ticlib and --with-termlib does not always
    586    produce libraries that can be run without setting environment variables.
    587 @@ -122,7 +140,7 @@
    588  2. DOS port
    589  
    590  Only a few of the files in the library depend on the terminfo format.
    591 -It should be possible to further kernelize the package, then rewrite
    592 +It should be possible to further kernelize the package, then rewrite
    593  a small number of core files to produce a functionally-compatible
    594  port that would do updates to a memory-mapped screen area.  The first
    595  result of this would be a DOS port.
    596 @@ -195,10 +213,10 @@
    597                 move_insert, dest_tabs_magic_smso, transparent_underline,
    598                 needs_xon_xoff, hard_cursor.
    599         Numerics: lines_of_memory, buttons.
    600 -       Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
    601 -               enter_xon_mode, exit_xon_mode, xon_character, xoff_character,
    602 +       Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
    603 +               enter_xon_mode, exit_xon_mode, xon_character, xoff_character,
    604                 display_clock, remove_clock, user[0-5], display_pc_char,
    605 -               enter_scancode_mode, exit_scancode_mode, pc_term_options,
    606 +               enter_scancode_mode, exit_scancode_mode, pc_term_options,
    607                 scancode_escape, alt_scancode_esc.
    608  
    609  These are the potentially important ones for ncurses.  Notes:
    6109diff -Naur ncurses-5.7.orig/aclocal.m4 ncurses-5.7/aclocal.m4
    61110--- ncurses-5.7.orig/aclocal.m4 2008-10-25 15:15:32.000000000 -0700
    612 +++ ncurses-5.7/aclocal.m4      2009-01-18 23:56:41.000000000 -0800
     11+++ ncurses-5.7/aclocal.m4      2009-01-27 16:45:03.668729990 -0800
    61312@@ -1,5 +1,5 @@
    61413 dnl***************************************************************************
     
    1366765        ;;
    1367766 mirbsd*) #(vi
     767diff -Naur ncurses-5.7.orig/Ada95/gen/adacurses-config.in ncurses-5.7/Ada95/gen/adacurses-config.in
     768--- ncurses-5.7.orig/Ada95/gen/adacurses-config.in      2007-04-07 14:06:50.000000000 -0700
     769+++ ncurses-5.7/Ada95/gen/adacurses-config.in   2009-01-27 16:45:02.332643665 -0800
     770@@ -1,18 +1,47 @@
     771 #! /bin/sh
     772-# $Id: adacurses-config.in,v 1.2 2007/04/07 21:06:50 tom Exp $
     773-#
     774-# This script will return the option to add to `gnatmake' for using
     775-# AdaCurses.
     776+# $Id: adacurses-config.in,v 1.5 2009/01/11 00:08:19 tom Exp $
     777+##############################################################################
     778+# Copyright (c) 2007,2009 Free Software Foundation, Inc.                     #
     779+#                                                                            #
     780+# Permission is hereby granted, free of charge, to any person obtaining a    #
     781+# copy of this software and associated documentation files (the "Software"), #
     782+# to deal in the Software without restriction, including without limitation  #
     783+# the rights to use, copy, modify, merge, publish, distribute, distribute    #
     784+# with modifications, sublicense, and/or sell copies of the Software, and to #
     785+# permit persons to whom the Software is furnished to do so, subject to the  #
     786+# following conditions:                                                      #
     787+#                                                                            #
     788+# The above copyright notice and this permission notice shall be included in #
     789+# all copies or substantial portions of the Software.                        #
     790+#                                                                            #
     791+# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR #
     792+# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,   #
     793+# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL    #
     794+# THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER      #
     795+# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING    #
     796+# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER        #
     797+# DEALINGS IN THE SOFTWARE.                                                  #
     798+#                                                                            #
     799+# Except as contained in this notice, the name(s) of the above copyright     #
     800+# holders shall not be used in advertising or otherwise to promote the sale, #
     801+# use or other dealings in this Software without prior written               #
     802+# authorization.                                                             #
     803+##############################################################################
     804 #
     805+# This script returns the options to add to `gnatmake' for using AdaCurses.
     806+
     807+DESTDIR=@DESTDIR@
     808+prefix=@prefix@
     809+exec_prefix=@exec_prefix@
     810+libdir=@libdir@
     811 
     812-prefix="@prefix@"
     813-exec_prefix="@exec_prefix@"
     814-libdir="@libdir@"
     815+ADA_INCLUDE=@ADA_INCLUDE@
     816+ADA_OBJECTS=@ADA_OBJECTS@
     817 
     818-VERSION="@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@"
     819+VERSION=@NCURSES_MAJOR@.@NCURSES_MINOR@.@NCURSES_PATCH@
     820 
     821-CFLAGS="-I$libdir/adacurses -L$libdir/adacurses"
     822-LIBS="-L$prefix/lib -lAdaCurses"
     823+CFLAGS="-I$ADA_INCLUDE -aO$ADA_OBJECTS"
     824+LIBS="-L$ADA_OBJECTS -lAdaCurses"
     825 
     826 case "x$1" in
     827     x--version)
     828@@ -26,10 +55,10 @@
     829         ;;
     830     x)
     831        # if no parameter is given, give what gnatmake needs
     832-        echo $CFLAGS -largs $LIBS
     833+        echo "$CFLAGS -i -largs $LIBS"
     834         ;;
     835     *)
     836-        echo 'Usage: adacurses-config [--version | --cflags | --libs]' >&2
     837+        echo 'Usage: adacurses@DFT_ARG_SUFFIX@-config [--version | --cflags | --libs]' >&2
     838         exit 1
     839         ;;
     840 esac
     841diff -Naur ncurses-5.7.orig/Ada95/gen/Makefile.in ncurses-5.7/Ada95/gen/Makefile.in
     842--- ncurses-5.7.orig/Ada95/gen/Makefile.in      2008-10-04 15:58:31.000000000 -0700
     843+++ ncurses-5.7/Ada95/gen/Makefile.in   2009-01-27 16:45:02.332643665 -0800
     844@@ -1,5 +1,5 @@
     845 ##############################################################################
     846-# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.                #
     847+# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
     848 #                                                                            #
     849 # Permission is hereby granted, free of charge, to any person obtaining a    #
     850 # copy of this software and associated documentation files (the "Software"), #
     851@@ -28,7 +28,7 @@
     852 #
     853 #  Author:  Juergen Pfeifer, 1996
     854 #
     855-#  $Id: Makefile.in,v 1.61 2008/10/04 22:58:31 tom Exp $
     856+#  $Id: Makefile.in,v 1.63 2009/01/11 01:11:35 tom Exp $
     857 #
     858 .SUFFIXES:
     859 
     860@@ -81,7 +81,7 @@
     861 M4             = m4
     862 M4FLAGS                = -DNCURSES_EXT_FUNCS=@NCURSES_EXT_FUNCS@
     863 
     864-ADACURSES_CONFIG = adacurses-config
     865+ADACURSES_CONFIG = adacurses@DFT_ARG_SUFFIX@-config
     866 
     867 WRAPPER                = sh $(top_srcdir)/misc/shlib
     868 GENERATE       = ./gen$x '@DFT_ARG_SUFFIX@'
     869@@ -166,6 +166,7 @@
     870 
     871 sources:
     872 
     873+$(DESTDIR)$(bindir) \
     874 $(ADA_INCLUDE) \
     875 $(ADA_OBJECTS) :
     876        sh $(top_srcdir)/mkdirs.sh $@
     877@@ -187,8 +188,8 @@
     878        @-chmod u+x $(ADA_SRCDIR)/*.ali
     879 
     880 install \
     881-install.libs :: $(DESTDIR)$(bindir) adacurses-config
     882-       $(INSTALL_PROG) adacurses-config $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
     883+install.libs :: $(DESTDIR)$(bindir) $(ADACURSES_CONFIG)
     884+       $(INSTALL_PROG) $(ADACURSES_CONFIG) $(DESTDIR)$(bindir)/$(ADACURSES_CONFIG)
     885 
     886 uninstall \
     887 uninstall.libs ::
     888@@ -398,7 +399,7 @@
     889        -rm -f $(GEN_TARGETS) instab.tmp *.ad[bs] *.html *.ali *.tmp
     890 
     891 distclean :: clean
     892-       -rm -f adacurses-config
     893+       -rm -f $(ADACURSES_CONFIG)
     894        -rm -f Makefile
     895 
     896 realclean :: distclean
     897diff -Naur ncurses-5.7.orig/Ada95/samples/Makefile.in ncurses-5.7/Ada95/samples/Makefile.in
     898--- ncurses-5.7.orig/Ada95/samples/Makefile.in  2006-12-17 08:45:02.000000000 -0800
     899+++ ncurses-5.7/Ada95/samples/Makefile.in       2009-01-27 16:45:02.332643665 -0800
     900@@ -1,5 +1,5 @@
     901 ##############################################################################
     902-# Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.                #
     903+# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
     904 #                                                                            #
     905 # Permission is hereby granted, free of charge, to any person obtaining a    #
     906 # copy of this software and associated documentation files (the "Software"), #
     907@@ -28,7 +28,7 @@
     908 #
     909 #  Author:  Juergen Pfeifer, 1996
     910 #
     911-#  $Id: Makefile.in,v 1.34 2006/12/17 16:45:02 tom Exp $
     912+#  $Id: Makefile.in,v 1.36 2009/01/11 01:11:54 tom Exp $
     913 #
     914 .SUFFIXES:
     915 
     916@@ -88,8 +88,8 @@
     917 
     918 CARGS        =-cargs $(ADAFLAGS)
     919 LARGS        =-largs @TEST_ARG2@ $(LD_FLAGS) -lAdaCurses
     920-
     921-PROGS        = tour rain ncurses
     922+
     923+PROGS        = tour rain ncurses
     924 
     925 TOUR_OBJS    = tour.o sample.o sample-curses_demo.o sample-explanation.o       \
     926                sample-form_demo.o sample-function_key_setting.o                \
     927@@ -145,7 +145,7 @@
     928 
     929 clean :: mostlyclean
     930        rm -f *.o *.ali b_t*.* *.s $(PROGS) a.out core b_*_test.c *.xr[bs] \
     931-       explain.msg trace screendump
     932+       explain.msg trace screendump b~*.ad[bs]
     933 
     934 distclean :: clean
     935        rm -f Makefile
     936diff -Naur ncurses-5.7.orig/Ada95/src/Makefile.in ncurses-5.7/Ada95/src/Makefile.in
     937--- ncurses-5.7.orig/Ada95/src/Makefile.in      2007-09-15 11:22:24.000000000 -0700
     938+++ ncurses-5.7/Ada95/src/Makefile.in   2009-01-27 16:45:02.332643665 -0800
     939@@ -1,5 +1,5 @@
     940 ##############################################################################
     941-# Copyright (c) 1998-2003,2004 Free Software Foundation, Inc.                #
     942+# Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.                #
     943 #                                                                            #
     944 # Permission is hereby granted, free of charge, to any person obtaining a    #
     945 # copy of this software and associated documentation files (the "Software"), #
     946@@ -28,7 +28,7 @@
     947 #
     948 #  Author:  Juergen Pfeifer, 1996
     949 #
     950-#  $Id: Makefile.in,v 1.31 2007/09/15 18:22:24 tom Exp $
     951+#  $Id: Makefile.in,v 1.34 2009/01/11 01:11:44 tom Exp $
     952 #
     953 .SUFFIXES:
     954 
     955@@ -36,17 +36,22 @@
     956 THIS           = Makefile
     957 
     958 MODEL          = ../../@DFT_OBJ_SUBDIR@
     959+
     960 DESTDIR                = @DESTDIR@
     961+
     962+top_srcdir     = @top_srcdir@
     963 srcdir         = @srcdir@
     964 prefix         = @prefix@
     965 exec_prefix    = @exec_prefix@
     966-ADA_INCLUDE    = @ADA_INCLUDE@
     967+
     968+ADA_INCLUDE    = $(DESTDIR)@ADA_INCLUDE@
     969+ADA_OBJECTS    = $(DESTDIR)@ADA_OBJECTS@
     970 
     971 INSTALL                = @INSTALL@
     972-INSTALL_DATA   = @INSTALL_DATA@
     973+INSTALL_LIB    = @INSTALL@ @INSTALL_LIB@
     974 
     975 AR             = @AR@
     976-AR_OPTS                = @AR_OPTS@
     977+ARFLAGS                = @ARFLAGS@
     978 AWK            = @AWK@
     979 LN_S           = @LN_S@
     980 
     981@@ -75,11 +80,12 @@
     982 ADAFLAGS        = @ADAFLAGS@ -I. -I$(srcdir)
     983 
     984 ADAMAKE         = @cf_ada_make@
     985-ADAMAKEFLAGS    =
     986+ADAMAKEFLAGS    =
     987 
     988 CARGS           = -cargs $(ADAFLAGS)
     989 LARGS           =
     990 
     991+LIBRARY_FILE   = libAdaCurses.a
     992 ALIB            = @cf_ada_package@
     993 ABASE           = $(ALIB)-curses
     994 
     995@@ -164,21 +170,25 @@
     996        $(ABASE)-text_io-complex_io.o
     997 
     998 
     999-all ::  libAdaCurses.a
     1000+all ::  $(LIBRARY_FILE)
     1001        @echo done
     1002 
     1003-libAdaCurses.a :: dotouch $(LIBOBJS) @cf_generic_objects@
     1004-       $(AR) $(AR_OPTS) $@ $(LIBOBJS) @cf_generic_objects@
     1005-
     1006-dotouch :
     1007-       @sh -c 'for f in $(LIBALIS) $(GENALIS); do test -f $$f || touch $$f; done'
     1008+$(LIBRARY_FILE) :: $(LIBOBJS) @cf_generic_objects@
     1009+       $(AR) $(ARFLAGS) $@ $(LIBOBJS) @cf_generic_objects@
     1010 
     1011 sources :
     1012        @echo made $@
     1013 
     1014 libs \
     1015 install \
     1016-install.libs \
     1017+install.libs :: $(LIBRARY_FILE)
     1018+       @echo made $(LIBRARY_FILE)
     1019+
     1020+install \
     1021+install.libs :: $(LIBRARY_FILE)
     1022+       @$(top_srcdir)/tar-copy.sh $(LIBRARY_FILE) . $(ADA_OBJECTS)
     1023+       @echo made $@
     1024+
     1025 uninstall \
     1026 uninstall.libs ::
     1027        @echo made $@
     1028diff -Naur ncurses-5.7.orig/Ada95/src/terminal_interface-curses-mouse.adb ncurses-5.7/Ada95/src/terminal_interface-curses-mouse.adb
     1029--- ncurses-5.7.orig/Ada95/src/terminal_interface-curses-mouse.adb      2008-07-26 11:51:11.000000000 -0700
     1030+++ ncurses-5.7/Ada95/src/terminal_interface-curses-mouse.adb   2009-01-27 16:44:46.507629836 -0800
     1031@@ -35,8 +35,8 @@
     1032 ------------------------------------------------------------------------------
     1033 --  Author:  Juergen Pfeifer, 1996
     1034 --  Version Control:
     1035---  $Revision: 1.22 $
     1036---  $Date: 2008/07/26 18:51:11 $
     1037+--  $Revision: 1.23 $
     1038+--  $Date: 2008/11/16 00:19:59 $
     1039 --  Binding Version 01.00
     1040 ------------------------------------------------------------------------------
     1041 with Terminal_Interface.Curses.Aux; use Terminal_Interface.Curses.Aux;
     1042@@ -50,7 +50,7 @@
     1043    function Has_Mouse return Boolean
     1044    is
     1045       function Mouse_Avail return C_Int;
     1046-      pragma Import (C, Mouse_Avail, "_nc_has_mouse");
     1047+      pragma Import (C, Mouse_Avail, "has_mouse");
     1048    begin
     1049       if Has_Key (Key_Mouse) or else Mouse_Avail /= 0 then
     1050          return True;
     1051diff -Naur ncurses-5.7.orig/c++/cursesw.cc ncurses-5.7/c++/cursesw.cc
     1052--- ncurses-5.7.orig/c++/cursesw.cc     2007-12-15 15:01:57.000000000 -0800
     1053+++ ncurses-5.7/c++/cursesw.cc  2009-01-27 16:44:46.511630953 -0800
     1054@@ -1,6 +1,6 @@
     1055 // * this is for making emacs happy: -*-Mode: C++;-*-
     1056 /****************************************************************************
     1057- * Copyright (c) 2007 Free Software Foundation, Inc.                        *
     1058+ * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
     1059  *                                                                          *
     1060  * Permission is hereby granted, free of charge, to any person obtaining a  *
     1061  * copy of this software and associated documentation files (the            *
     1062@@ -42,7 +42,7 @@
     1063 #include "internal.h"
     1064 #include "cursesw.h"
     1065 
     1066-MODULE_ID("$Id: cursesw.cc,v 1.49 2007/12/15 23:01:57 tom Exp $")
     1067+MODULE_ID("$Id: cursesw.cc,v 1.50 2008/11/23 00:17:31 juergen Exp $")
     1068 
     1069 #define COLORS_NEED_INITIALIZATION  -1
     1070 #define COLORS_NOT_INITIALIZED       0
     1071@@ -287,7 +287,6 @@
     1072 {
     1073     initialize();
     1074     w = win;
     1075-    assert((w->_maxx +1 ) == ncols);
     1076 }
     1077 
     1078 int _nc_xx_ripoff_init(WINDOW *w, int ncols)
     1079@@ -464,7 +463,7 @@
     1080 #if HAVE_HAS_KEY
     1081 bool NCursesWindow::has_mouse() const
     1082 {
     1083-    return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse())
     1084+    return ((::has_key(KEY_MOUSE) || ::has_mouse())
     1085             ? TRUE : FALSE);
     1086 }
     1087 #endif
    13681088diff -Naur ncurses-5.7.orig/c++/Makefile.in ncurses-5.7/c++/Makefile.in
    13691089--- ncurses-5.7.orig/c++/Makefile.in    2007-04-28 08:29:12.000000000 -0700
    1370 +++ ncurses-5.7/c++/Makefile.in 2009-01-18 23:56:34.000000000 -0800
     1090+++ ncurses-5.7/c++/Makefile.in 2009-01-27 16:44:58.008364855 -0800
    13711091@@ -1,6 +1,6 @@
    13721092-# $Id: Makefile.in,v 1.84 2007/04/28 15:29:12 tom Exp $
     
    14001120 
    14011121 ../lib/$(LIBNAME_LIBTOOL) : $(LIB_OBJS)
    1402 diff -Naur ncurses-5.7.orig/c++/cursesw.cc ncurses-5.7/c++/cursesw.cc
    1403 --- ncurses-5.7.orig/c++/cursesw.cc     2007-12-15 15:01:57.000000000 -0800
    1404 +++ ncurses-5.7/c++/cursesw.cc  2009-01-18 23:56:21.000000000 -0800
    1405 @@ -1,6 +1,6 @@
    1406  // * this is for making emacs happy: -*-Mode: C++;-*-
    1407  /****************************************************************************
    1408 - * Copyright (c) 2007 Free Software Foundation, Inc.                        *
    1409 + * Copyright (c) 2007,2008 Free Software Foundation, Inc.                   *
    1410   *                                                                          *
    1411   * Permission is hereby granted, free of charge, to any person obtaining a  *
    1412   * copy of this software and associated documentation files (the            *
    1413 @@ -42,7 +42,7 @@
    1414  #include "internal.h"
    1415  #include "cursesw.h"
    1416  
    1417 -MODULE_ID("$Id: cursesw.cc,v 1.49 2007/12/15 23:01:57 tom Exp $")
    1418 +MODULE_ID("$Id: cursesw.cc,v 1.50 2008/11/23 00:17:31 juergen Exp $")
    1419  
    1420  #define COLORS_NEED_INITIALIZATION  -1
    1421  #define COLORS_NOT_INITIALIZED       0
    1422 @@ -287,7 +287,6 @@
    1423  {
    1424      initialize();
    1425      w = win;
    1426 -    assert((w->_maxx +1 ) == ncols);
    1427  }
    1428  
    1429  int _nc_xx_ripoff_init(WINDOW *w, int ncols)
    1430 @@ -464,7 +463,7 @@
    1431  #if HAVE_HAS_KEY
    1432  bool NCursesWindow::has_mouse() const
    1433  {
    1434 -    return ((::has_key(KEY_MOUSE) || ::_nc_has_mouse())
    1435 +    return ((::has_key(KEY_MOUSE) || ::has_mouse())
    1436              ? TRUE : FALSE);
    1437  }
    1438  #endif
    14391122diff -Naur ncurses-5.7.orig/config.guess ncurses-5.7/config.guess
    14401123--- ncurses-5.7.orig/config.guess       2008-08-30 13:25:07.000000000 -0700
    1441 +++ ncurses-5.7/config.guess    2009-01-18 23:56:34.000000000 -0800
     1124+++ ncurses-5.7/config.guess    2009-01-27 16:44:58.008364855 -0800
    14421125@@ -4,7 +4,7 @@
    14431126 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     
    15091192diff -Naur ncurses-5.7.orig/config.sub ncurses-5.7/config.sub
    15101193--- ncurses-5.7.orig/config.sub 2008-08-30 13:25:02.000000000 -0700
    1511 +++ ncurses-5.7/config.sub      2009-01-18 23:56:34.000000000 -0800
     1194+++ ncurses-5.7/config.sub      2009-01-27 16:44:58.008364855 -0800
    15121195@@ -4,7 +4,7 @@
    15131196 #   2000, 2001, 2002, 2003, 2004, 2005, 2006, 2007, 2008
     
    15931276diff -Naur ncurses-5.7.orig/configure ncurses-5.7/configure
    15941277--- ncurses-5.7.orig/configure  2008-10-25 17:04:38.000000000 -0700
    1595 +++ ncurses-5.7/configure       2009-01-18 23:56:41.000000000 -0800
     1278+++ ncurses-5.7/configure       2009-01-27 16:45:03.672730548 -0800
    15961279@@ -1,7 +1,7 @@
    15971280 #! /bin/sh
     
    1327812961diff -Naur ncurses-5.7.orig/configure.in ncurses-5.7/configure.in
    1327912962--- ncurses-5.7.orig/configure.in       2008-10-18 07:53:32.000000000 -0700
    13280 +++ ncurses-5.7/configure.in    2009-01-18 23:56:40.000000000 -0800
     12963+++ ncurses-5.7/configure.in    2009-01-27 16:45:02.344642827 -0800
    1328112964@@ -1,5 +1,5 @@
    1328212965 dnl***************************************************************************
     
    1347713160diff -Naur ncurses-5.7.orig/dist.mk ncurses-5.7/dist.mk
    1347813161--- ncurses-5.7.orig/dist.mk    2008-11-01 17:58:38.000000000 -0700
    13479 +++ ncurses-5.7/dist.mk 2009-01-18 23:56:41.000000000 -0800
     13162+++ ncurses-5.7/dist.mk 2009-01-27 16:45:05.084820505 -0800
    1348013163@@ -25,7 +25,7 @@
    1348113164 # use or other dealings in this Software without prior written               #
     
    1348313166 ##############################################################################
    1348413167-# $Id: dist.mk,v 1.671 2008/11/02 00:58:38 tom Exp $
    13485 +# $Id: dist.mk,v 1.683 2009/01/17 16:29:15 tom Exp $
     13168+# $Id: dist.mk,v 1.684 2009/01/24 20:49:01 tom Exp $
    1348613169 # Makefile for creating ncurses distributions.
    1348713170 #
     
    1349213175 NCURSES_MINOR = 7
    1349313176-NCURSES_PATCH = 20081102
    13494 +NCURSES_PATCH = 20090117
     13177+NCURSES_PATCH = 20090124
    1349513178 
    1349613179 # We don't append the patch to the version, since this only applies to releases
    1349713180 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
     13181diff -Naur ncurses-5.7.orig/form/frm_driver.c ncurses-5.7/form/frm_driver.c
     13182--- ncurses-5.7.orig/form/frm_driver.c  2008-10-18 09:25:00.000000000 -0700
     13183+++ ncurses-5.7/form/frm_driver.c       2009-01-27 16:44:49.391812822 -0800
     13184@@ -32,7 +32,7 @@
     13185 
     13186 #include "form.priv.h"
     13187 
     13188-MODULE_ID("$Id: frm_driver.c,v 1.88 2008/10/18 16:25:00 tom Exp $")
     13189+MODULE_ID("$Id: frm_driver.c,v 1.89 2008/12/06 23:08:12 tom Exp $")
     13190 
     13191 /*----------------------------------------------------------------------------
     13192   This is the core module of the form library. It contains the majority
     13193@@ -4366,6 +4366,7 @@
     13194       delwin(field->working);
     13195       field->working = newpad(field->drows, field->dcols);
     13196     }
     13197+  len = Buffer_Length(field);
     13198   wclear(field->working);
     13199   mvwaddstr(field->working, 0, 0, value);
     13200 
    1349813201diff -Naur ncurses-5.7.orig/form/Makefile.in ncurses-5.7/form/Makefile.in
    1349913202--- ncurses-5.7.orig/form/Makefile.in   2007-04-28 07:56:11.000000000 -0700
    13500 +++ ncurses-5.7/form/Makefile.in        2009-01-18 23:56:35.000000000 -0800
     13203+++ ncurses-5.7/form/Makefile.in        2009-01-27 16:44:58.024366252 -0800
    1350113204@@ -1,6 +1,6 @@
    1350213205-# $Id: Makefile.in,v 1.47 2007/04/28 14:56:11 tom Exp $
     
    1351713220 LD             = @LD@
    1351813221 LN_S           = @LN_S@
    13519 diff -Naur ncurses-5.7.orig/form/frm_driver.c ncurses-5.7/form/frm_driver.c
    13520 --- ncurses-5.7.orig/form/frm_driver.c  2008-10-18 09:25:00.000000000 -0700
    13521 +++ ncurses-5.7/form/frm_driver.c       2009-01-18 23:56:25.000000000 -0800
    13522 @@ -32,7 +32,7 @@
    13523  
    13524  #include "form.priv.h"
    13525  
    13526 -MODULE_ID("$Id: frm_driver.c,v 1.88 2008/10/18 16:25:00 tom Exp $")
    13527 +MODULE_ID("$Id: frm_driver.c,v 1.89 2008/12/06 23:08:12 tom Exp $")
    13528  
    13529  /*----------------------------------------------------------------------------
    13530    This is the core module of the form library. It contains the majority
    13531 @@ -4366,6 +4366,7 @@
    13532        delwin(field->working);
    13533        field->working = newpad(field->drows, field->dcols);
    13534      }
    13535 +  len = Buffer_Length(field);
    13536    wclear(field->working);
    13537    mvwaddstr(field->working, 0, 0, value);
    13538  
    1353913222diff -Naur ncurses-5.7.orig/include/curses.h.in ncurses-5.7/include/curses.h.in
    1354013223--- ncurses-5.7.orig/include/curses.h.in        2008-08-30 13:11:29.000000000 -0700
    13541 +++ ncurses-5.7/include/curses.h.in     2009-01-18 23:56:29.000000000 -0800
     13224+++ ncurses-5.7/include/curses.h.in     2009-01-27 16:44:52.892037156 -0800
    1354213225@@ -32,7 +32,7 @@
    1354313226  *     and: Thomas E. Dickey                        1996-on                 *
     
    1359513278diff -Naur ncurses-5.7.orig/include/curses.tail ncurses-5.7/include/curses.tail
    1359613279--- ncurses-5.7.orig/include/curses.tail        2008-07-05 13:20:38.000000000 -0700
    13597 +++ ncurses-5.7/include/curses.tail     2009-01-18 23:56:21.000000000 -0800
     13280+++ ncurses-5.7/include/curses.tail     2009-01-27 16:44:46.511630953 -0800
    1359813281@@ -1,4 +1,4 @@
    1359913282-/* $Id: curses.tail,v 1.16 2008/07/05 20:20:38 tom Exp $ */
     
    1361213295diff -Naur ncurses-5.7.orig/include/curses.wide ncurses-5.7/include/curses.wide
    1361313296--- ncurses-5.7.orig/include/curses.wide        2007-03-10 09:52:23.000000000 -0800
    13614 +++ ncurses-5.7/include/curses.wide     2009-01-18 23:56:23.000000000 -0800
     13297+++ ncurses-5.7/include/curses.wide     2009-01-27 16:44:48.051726777 -0800
    1361513298@@ -1,9 +1,11 @@
    1361613299-/* $Id: curses.wide,v 1.34 2007/03/10 17:52:23 tom Exp $ */
     
    1362613309 
    1362713310 extern NCURSES_EXPORT_VAR(cchar_t *) _nc_wacs;
     13311diff -Naur ncurses-5.7.orig/INSTALL ncurses-5.7/INSTALL
     13312--- ncurses-5.7.orig/INSTALL    2008-11-02 13:13:51.000000000 -0800
     13313+++ ncurses-5.7/INSTALL 2009-01-27 16:44:58.000364576 -0800
     13314@@ -1,5 +1,5 @@
     13315 -------------------------------------------------------------------------------
     13316--- Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.               --
     13317+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.               --
     13318 --                                                                           --
     13319 -- Permission is hereby granted, free of charge, to any person obtaining a   --
     13320 -- copy of this software and associated documentation files (the             --
     13321@@ -25,7 +25,7 @@
     13322 -- sale, use or other dealings in this Software without prior written        --
     13323 -- authorization.                                                            --
     13324 -------------------------------------------------------------------------------
     13325--- $Id: INSTALL,v 1.135 2008/11/02 21:13:51 tom Exp $
     13326+-- $Id: INSTALL,v 1.137 2009/01/03 23:59:23 tom Exp $
     13327 ---------------------------------------------------------------------
     13328              How to install Ncurses/Terminfo on your system
     13329 ---------------------------------------------------------------------
     13330@@ -525,6 +525,11 @@
     13331        terminfo entries.  This is the default, unless you have disabled the
     13332        extended functions.
     13333 
     13334+    --enable-pc-files
     13335+       If pkg-config is found (see --with-pkg-config), generate ".pc" files
     13336+       for each of the libraries, and install them in pkg-config's library
     13337+       directory.
     13338+
     13339     --enable-reentrant
     13340        Compile experimental configuration which improves reentrant use of the
     13341        library by reducing global and static variables.  This option is also
     13342@@ -850,6 +855,9 @@
     13343        those using termcap, do not use the higher speeds.  Your application
     13344        (or system, in general) may or may not.
     13345 
     13346+    --with-pkg-config=[DIR]
     13347+       Check for pkg-config, optionally specifying its path.
     13348+
     13349     --with-profile
     13350        Generate profile-libraries These are named by adding "_p" to the root,
     13351        e.g., libncurses_p.a
     13352@@ -975,6 +983,9 @@
     13353     --without-dlsym
     13354        Do not use dlsym() to load GPM dynamically.
     13355 
     13356+    --without-manpages
     13357+       Tell the configure script to suppress the install of ncurses' manpages.
     13358+
     13359     --without-progs
     13360        Tell the configure script to suppress the build of ncurses' application
     13361        programs (e.g., tic).  The test applications will still be built if you
     13362diff -Naur ncurses-5.7.orig/man/curs_color.3x ncurses-5.7/man/curs_color.3x
     13363--- ncurses-5.7.orig/man/curs_color.3x  2005-12-17 16:00:37.000000000 -0800
     13364+++ ncurses-5.7/man/curs_color.3x       2009-01-27 16:45:05.084820505 -0800
     13365@@ -1,5 +1,5 @@
     13366 .\"***************************************************************************
     13367-.\" Copyright (c) 1998-2004,2005 Free Software Foundation, Inc.              *
     13368+.\" Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
     13369 .\"                                                                          *
     13370 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
     13371 .\" copy of this software and associated documentation files (the            *
     13372@@ -26,7 +26,7 @@
     13373 .\" authorization.                                                           *
     13374 .\"***************************************************************************
     13375 .\"
     13376-.\" $Id: curs_color.3x,v 1.28 2005/12/18 00:00:37 tom Exp $
     13377+.\" $Id: curs_color.3x,v 1.29 2009/01/24 23:10:02 tom Exp $
     13378 .TH curs_color 3X ""
     13379 .na
     13380 .hy 0
     13381@@ -96,7 +96,10 @@
     13382 .TP 5
     13383 -
     13384 The value of the first argument
     13385-must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR.
     13386+must be between \fB1\fR and \fBCOLOR_PAIRS-1\fR,
     13387+except that if default colors are used (see \fBuse_default_colors\fP)
     13388+the upper limit is adjusted to allow for extra pairs which use
     13389+a default color in foreground and/or background.
     13390 .TP 5
     13391 -
     13392 The value of the second and
    1362813393diff -Naur ncurses-5.7.orig/man/curs_mouse.3x ncurses-5.7/man/curs_mouse.3x
    1362913394--- ncurses-5.7.orig/man/curs_mouse.3x  2006-12-30 15:43:34.000000000 -0800
    13630 +++ ncurses-5.7/man/curs_mouse.3x       2009-01-18 23:56:21.000000000 -0800
     13395+++ ncurses-5.7/man/curs_mouse.3x       2009-01-27 16:44:46.515630395 -0800
    1363113396@@ -1,6 +1,6 @@
    1363213397 '\" t
     
    1367413439diff -Naur ncurses-5.7.orig/man/keybound.3x ncurses-5.7/man/keybound.3x
    1367513440--- ncurses-5.7.orig/man/keybound.3x    2006-02-25 13:47:06.000000000 -0800
    13676 +++ ncurses-5.7/man/keybound.3x 2009-01-18 23:56:27.000000000 -0800
     13441+++ ncurses-5.7/man/keybound.3x 2009-01-27 16:44:51.023917306 -0800
    1367713442@@ -1,5 +1,5 @@
    1367813443 .\"***************************************************************************
     
    1369513460diff -Naur ncurses-5.7.orig/man/tabs.1 ncurses-5.7/man/tabs.1
    1369613461--- ncurses-5.7.orig/man/tabs.1 1969-12-31 16:00:00.000000000 -0800
    13697 +++ ncurses-5.7/man/tabs.1      2009-01-18 23:56:19.000000000 -0800
     13462+++ ncurses-5.7/man/tabs.1      2009-01-27 16:44:45.091537644 -0800
    1369813463@@ -0,0 +1,143 @@
    1369913464+.\"***************************************************************************
     
    1384213607diff -Naur ncurses-5.7.orig/man/tset.1 ncurses-5.7/man/tset.1
    1384313608--- ncurses-5.7.orig/man/tset.1 2006-12-24 07:00:30.000000000 -0800
    13844 +++ ncurses-5.7/man/tset.1      2009-01-18 23:56:19.000000000 -0800
     13609+++ ncurses-5.7/man/tset.1      2009-01-27 16:44:45.091537644 -0800
    1384513610@@ -1,5 +1,5 @@
    1384613611 .\"***************************************************************************
     
    1386113626 \fBtset\fR, \fBreset\fR - terminal initialization
    1386213627 .SH SYNOPSIS
     13628diff -Naur ncurses-5.7.orig/MANIFEST ncurses-5.7/MANIFEST
     13629--- ncurses-5.7.orig/MANIFEST   2008-10-25 16:47:24.000000000 -0700
     13630+++ ncurses-5.7/MANIFEST        2009-01-27 16:44:58.000364576 -0800
     13631@@ -640,6 +640,7 @@
     13632 ./man/ncurses.3x
     13633 ./man/panel.3x
     13634 ./man/resizeterm.3x
     13635+./man/tabs.1
     13636 ./man/term.5
     13637 ./man/term.7
     13638 ./man/terminfo.head
     13639@@ -694,6 +695,7 @@
     13640 ./misc/emx.src
     13641 ./misc/form.def
     13642 ./misc/form.ref
     13643+./misc/gen-pkgconfig.in
     13644 ./misc/gen_edit.sh
     13645 ./misc/jpf-indent
     13646 ./misc/makedef.cmd
     13647@@ -947,6 +949,7 @@
     13648 ./progs/infocmp.c
     13649 ./progs/modules
     13650 ./progs/progs.priv.h
     13651+./progs/tabs.c
     13652 ./progs/tic.c
     13653 ./progs/toe.c
     13654 ./progs/tput.c
     13655@@ -963,6 +966,7 @@
     13656 ./test/cardfile.c
     13657 ./test/cardfile.dat
     13658 ./test/chgat.c
     13659+./test/clip_printw.c
     13660 ./test/color_set.c
     13661 ./test/configure
     13662 ./test/configure.in
     13663@@ -990,6 +994,7 @@
     13664 ./test/inch_wide.c
     13665 ./test/inchs.c
     13666 ./test/ins_wide.c
     13667+./test/insdelln.c
     13668 ./test/inserts.c
     13669 ./test/key_names.c
     13670 ./test/keynames.c
    1386313671diff -Naur ncurses-5.7.orig/menu/Makefile.in ncurses-5.7/menu/Makefile.in
    1386413672--- ncurses-5.7.orig/menu/Makefile.in   2007-04-28 07:56:11.000000000 -0700
    13865 +++ ncurses-5.7/menu/Makefile.in        2009-01-18 23:56:35.000000000 -0800
     13673+++ ncurses-5.7/menu/Makefile.in        2009-01-27 16:44:58.024366252 -0800
    1386613674@@ -1,6 +1,6 @@
    1386713675-# $Id: Makefile.in,v 1.48 2007/04/28 14:56:11 tom Exp $
     
    1388213690 LD             = @LD@
    1388313691 LN_S           = @LN_S@
    13884 diff -Naur ncurses-5.7.orig/misc/Makefile.in ncurses-5.7/misc/Makefile.in
    13885 --- ncurses-5.7.orig/misc/Makefile.in   2007-03-31 08:54:17.000000000 -0700
    13886 +++ ncurses-5.7/misc/Makefile.in        2009-01-18 23:56:35.000000000 -0800
    13887 @@ -1,6 +1,6 @@
    13888 -# $Id: Makefile.in,v 1.43 2007/03/31 15:54:17 tom Exp $
    13889 +# $Id: Makefile.in,v 1.48 2009/01/03 23:52:41 tom Exp $
    13890  ##############################################################################
    13891 -# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
    13892 +# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
    13893  #                                                                            #
    13894  # Permission is hereby granted, free of charge, to any person obtaining a    #
    13895  # copy of this software and associated documentation files (the "Software"), #
    13896 @@ -66,9 +66,11 @@
    13897  source         = @TERMINFO_SRC@
    13898  
    13899  INSTALL                = @INSTALL@
    13900 -INSTALL_PROG   = @INSTALL_PROGRAM@
    13901 +INSTALL_PROG   = @INSTALL_SCRIPT@
    13902  INSTALL_DATA   = @INSTALL_DATA@
    13903  
    13904 +PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
    13905 +
    13906  ################################################################################
    13907  all :  terminfo.tmp
    13908  
    13909 @@ -103,9 +105,16 @@
    13910  
    13911  NCURSES_CONFIG = ncurses@DFT_ARG_SUFFIX@@cf_cv_abi_version@-config
    13912  
    13913 -install.libs : $(DESTDIR)$(bindir) ncurses-config
    13914 +install.libs :: $(DESTDIR)$(bindir) ncurses-config
    13915         $(INSTALL_PROG) ncurses-config $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
    13916  
    13917 +@MAKE_PC_FILES@install.libs :: pc-files
    13918 +@MAKE_PC_FILES@        $(SHELL) -c 'for name in *.pc; do $(INSTALL_DATA) $$name $(PKG_CONFIG_LIBDIR)/$$name; done'
    13919 +
    13920 +@MAKE_PC_FILES@pc-files :
    13921 +@MAKE_PC_FILES@        $(SHELL) ./gen-pkgconfig
    13922 +@MAKE_PC_FILES@        touch $@
    13923 +
    13924  terminfo.tmp : run_tic.sed $(source)
    13925         echo '** adjusting tabset paths'
    13926         sed -f run_tic.sed $(source) >terminfo.tmp
    13927 @@ -130,6 +139,7 @@
    13928  
    13929  uninstall.libs :
    13930         -rm -f $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
    13931 +@MAKE_PC_FILES@        $(SHELL) 'for name in *.pc; do rm -f $(PKG_CONFIG_LIBDIR)/$$name; done'
    13932  
    13933  tags :
    13934  
    13935 @@ -138,11 +148,13 @@
    13936  mostlyclean :
    13937         -rm -f terminfo.tmp
    13938         -rm -f run_tic.sed
    13939 +@MAKE_PC_FILES@        -rm -f *.pc pc-files
    13940         -rm -f core tags TAGS *~ *.bak *.ln *.atac trace
    13941  
    13942  clean :: mostlyclean
    13943  
    13944  distclean : clean
    13945 +@MAKE_PC_FILES@        -rm -f gen-pkgconfig
    13946         -rm -f Makefile run_tic.sh ncurses-config
    13947  
    13948  realclean : distclean
    1394913692diff -Naur ncurses-5.7.orig/misc/gen-pkgconfig.in ncurses-5.7/misc/gen-pkgconfig.in
    1395013693--- ncurses-5.7.orig/misc/gen-pkgconfig.in      1969-12-31 16:00:00.000000000 -0800
    13951 +++ ncurses-5.7/misc/gen-pkgconfig.in   2009-01-18 23:56:36.000000000 -0800
     13694+++ ncurses-5.7/misc/gen-pkgconfig.in   2009-01-27 16:45:05.084820505 -0800
    1395213695@@ -0,0 +1,119 @@
    1395313696+#!@SHELL@
    13954 +# $Id: gen-pkgconfig.in,v 1.4 2009/01/04 21:52:33 tom Exp $
     13697+# $Id: gen-pkgconfig.in,v 1.5 2009/01/24 21:06:36 tom Exp $
    1395513698+##############################################################################
    1395613699+# Copyright (c) 2009 Free Software Foundation, Inc.                          #
     
    1401213755+       name=`basename $lib`
    1401313756+       root=`basename $name "$DFT_DEP_SUFFIX"`
    14014 +       if test "$name" == "$root" ; then
     13757+       if test "$name" = "$root" ; then
    1401513758+               root=`basename $name "$CXX_LIB_SUFFIX"`
    14016 +               if test "$name" == "$root" ; then
     13759+               if test "$name" = "$root" ; then
    1401713760+                       continue
    1401813761+               fi
     
    1407013813+done
    1407113814+# vile:shmode
     13815diff -Naur ncurses-5.7.orig/misc/Makefile.in ncurses-5.7/misc/Makefile.in
     13816--- ncurses-5.7.orig/misc/Makefile.in   2007-03-31 08:54:17.000000000 -0700
     13817+++ ncurses-5.7/misc/Makefile.in        2009-01-27 16:45:05.084820505 -0800
     13818@@ -1,6 +1,6 @@
     13819-# $Id: Makefile.in,v 1.43 2007/03/31 15:54:17 tom Exp $
     13820+# $Id: Makefile.in,v 1.50 2009/01/24 21:42:15 tom Exp $
     13821 ##############################################################################
     13822-# Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
     13823+# Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.                #
     13824 #                                                                            #
     13825 # Permission is hereby granted, free of charge, to any person obtaining a    #
     13826 # copy of this software and associated documentation files (the "Software"), #
     13827@@ -66,15 +66,17 @@
     13828 source         = @TERMINFO_SRC@
     13829 
     13830 INSTALL                = @INSTALL@
     13831-INSTALL_PROG   = @INSTALL_PROGRAM@
     13832+INSTALL_PROG   = @INSTALL_SCRIPT@
     13833 INSTALL_DATA   = @INSTALL_DATA@
     13834 
     13835+PKG_CONFIG_LIBDIR = @PKG_CONFIG_LIBDIR@
     13836+
     13837 ################################################################################
     13838 all :  terminfo.tmp
     13839 
     13840 depend :
     13841 
     13842-sources :
     13843+sources :: terminfo.tmp
     13844 
     13845 install : install.data install.libs
     13846 
     13847@@ -103,9 +105,17 @@
     13848 
     13849 NCURSES_CONFIG = ncurses@DFT_ARG_SUFFIX@@cf_cv_abi_version@-config
     13850 
     13851-install.libs : $(DESTDIR)$(bindir) ncurses-config
     13852+install.libs :: $(DESTDIR)$(bindir) ncurses-config
     13853        $(INSTALL_PROG) ncurses-config $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
     13854 
     13855+@MAKE_PC_FILES@install.libs :: pc-files
     13856+@MAKE_PC_FILES@        $(SHELL) -c 'for name in *.pc; do $(INSTALL_DATA) $$name $(PKG_CONFIG_LIBDIR)/$$name; done'
     13857+
     13858+@MAKE_PC_FILES@sources :: pc-files
     13859+@MAKE_PC_FILES@pc-files :
     13860+@MAKE_PC_FILES@        $(SHELL) ./gen-pkgconfig
     13861+@MAKE_PC_FILES@        touch $@
     13862+
     13863 terminfo.tmp : run_tic.sed $(source)
     13864        echo '** adjusting tabset paths'
     13865        sed -f run_tic.sed $(source) >terminfo.tmp
     13866@@ -130,6 +140,7 @@
     13867 
     13868 uninstall.libs :
     13869        -rm -f $(DESTDIR)$(bindir)/$(NCURSES_CONFIG)
     13870+@MAKE_PC_FILES@        $(SHELL) 'for name in *.pc; do rm -f $(PKG_CONFIG_LIBDIR)/$$name; done'
     13871 
     13872 tags :
     13873 
     13874@@ -138,11 +149,13 @@
     13875 mostlyclean :
     13876        -rm -f terminfo.tmp
     13877        -rm -f run_tic.sed
     13878+@MAKE_PC_FILES@        -rm -f *.pc pc-files
     13879        -rm -f core tags TAGS *~ *.bak *.ln *.atac trace
     13880 
     13881 clean :: mostlyclean
     13882 
     13883 distclean : clean
     13884+@MAKE_PC_FILES@        -rm -f gen-pkgconfig
     13885        -rm -f Makefile run_tic.sh ncurses-config
     13886 
     13887 realclean : distclean
    1407213888diff -Naur ncurses-5.7.orig/misc/ncurses-config.in ncurses-5.7/misc/ncurses-config.in
    1407313889--- ncurses-5.7.orig/misc/ncurses-config.in     2007-03-17 13:02:19.000000000 -0700
    14074 +++ ncurses-5.7/misc/ncurses-config.in  2009-01-18 23:56:38.000000000 -0800
     13890+++ ncurses-5.7/misc/ncurses-config.in  2009-01-27 16:45:05.084820505 -0800
    1407513891@@ -1,7 +1,7 @@
    1407613892 #!@SHELL@
    1407713893-# $Id: ncurses-config.in,v 1.12 2007/03/17 20:02:19 tom Exp $
    14078 +# $Id: ncurses-config.in,v 1.21 2009/01/06 01:06:21 tom Exp $
     13894+# $Id: ncurses-config.in,v 1.22 2009/01/24 21:06:45 tom Exp $
    1407913895 ##############################################################################
    1408013896-# Copyright (c) 2006,2007 Free Software Foundation, Inc.                     #
     
    1415513971-               if test "@WITH_OVERWRITE@" != no ; then
    1415613972-                       INCS="$INCS -I${prefix}/include/${THIS}"
    14157 +               if test "x@WITH_OVERWRITE@" == xno ; then
     13973+               if test "x@WITH_OVERWRITE@" = xno ; then
    1415813974+                       INCS="$INCS -I${includedir}/${THIS}"
    1415913975                fi
     
    1419914015diff -Naur ncurses-5.7.orig/misc/terminfo.src ncurses-5.7/misc/terminfo.src
    1420014016--- ncurses-5.7.orig/misc/terminfo.src  2008-10-12 16:03:54.000000000 -0700
    14201 +++ ncurses-5.7/misc/terminfo.src       2009-01-18 23:56:40.000000000 -0800
     14017+++ ncurses-5.7/misc/terminfo.src       2009-01-27 16:45:02.352643385 -0800
    1420214018@@ -6,8 +6,8 @@
    1420314019 # Report bugs and new terminal descriptions to
     
    1436514181diff -Naur ncurses-5.7.orig/mk-1st.awk ncurses-5.7/mk-1st.awk
    1436614182--- ncurses-5.7.orig/mk-1st.awk 2007-03-24 15:10:55.000000000 -0700
    14367 +++ ncurses-5.7/mk-1st.awk      2009-01-18 23:56:36.000000000 -0800
     14183+++ ncurses-5.7/mk-1st.awk      2009-01-27 16:44:59.364453973 -0800
    1436814184@@ -1,6 +1,6 @@
    1436914185-# $Id: mk-1st.awk,v 1.78 2007/03/24 22:10:55 tom Exp $
     
    1439314209                                if ( host == "vxworks" )
    1439414210                                {
    14395 diff -Naur ncurses-5.7.orig/ncurses/Makefile.in ncurses-5.7/ncurses/Makefile.in
    14396 --- ncurses-5.7.orig/ncurses/Makefile.in        2008-10-18 07:11:54.000000000 -0700
    14397 +++ ncurses-5.7/ncurses/Makefile.in     2009-01-18 23:56:35.000000000 -0800
    14398 @@ -1,6 +1,6 @@
    14399 -# $Id: Makefile.in,v 1.113 2008/10/18 14:11:54 tom Exp $
    14400 +# $Id: Makefile.in,v 1.114 2009/01/03 19:09:26 tom Exp $
    14401  ##############################################################################
    14402 -# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.                #
    14403 +# Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.                #
    14404  #                                                                            #
    14405  # Permission is hereby granted, free of charge, to any person obtaining a    #
    14406  # copy of this software and associated documentation files (the "Software"), #
    14407 @@ -78,7 +78,7 @@
    14408  INSTALL_DATA   = @INSTALL_DATA@
    14409  
    14410  AR             = @AR@
    14411 -AR_OPTS                = @AR_OPTS@
    14412 +ARFLAGS                = @ARFLAGS@
    14413  AWK            = @AWK@
    14414  LD             = @LD@
    14415  LN_S           = @LN_S@
    1441614211diff -Naur ncurses-5.7.orig/ncurses/base/lib_addch.c ncurses-5.7/ncurses/base/lib_addch.c
    1441714212--- ncurses-5.7.orig/ncurses/base/lib_addch.c   2008-08-16 12:20:04.000000000 -0700
    14418 +++ ncurses-5.7/ncurses/base/lib_addch.c        2009-01-18 23:56:41.000000000 -0800
     14213+++ ncurses-5.7/ncurses/base/lib_addch.c        2009-01-27 16:45:03.676729990 -0800
    1441914214@@ -1,5 +1,5 @@
    1442014215 /****************************************************************************
     
    1447114266            /*
    1447214267             * Check for cells which are orphaned by adding this character, set
     14268diff -Naur ncurses-5.7.orig/ncurses/base/lib_color.c ncurses-5.7/ncurses/base/lib_color.c
     14269--- ncurses-5.7.orig/ncurses/base/lib_color.c   2007-04-07 10:07:28.000000000 -0700
     14270+++ ncurses-5.7/ncurses/base/lib_color.c        2009-01-27 16:45:05.088820784 -0800
     14271@@ -1,5 +1,5 @@
     14272 /****************************************************************************
     14273- * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.              *
     14274+ * Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.              *
     14275  *                                                                          *
     14276  * Permission is hereby granted, free of charge, to any person obtaining a  *
     14277  * copy of this software and associated documentation files (the            *
     14278@@ -42,7 +42,7 @@
     14279 #include <term.h>
     14280 #include <tic.h>
     14281 
     14282-MODULE_ID("$Id: lib_color.c,v 1.85 2007/04/07 17:07:28 tom Exp $")
     14283+MODULE_ID("$Id: lib_color.c,v 1.87 2009/01/25 00:25:31 tom Exp $")
     14284 
     14285 /*
     14286  * These should be screen structure members.  They need to be globals for
     14287@@ -108,6 +108,13 @@
     14288 };
     14289 /* *INDENT-ON* */
     14290 
     14291+/*
     14292+ * Ensure that we use color pairs only when colors have been started, and also
     14293+ * that the index is within the limits of the table which we allocated.
     14294+ */
     14295+#define ValidPair(pair) \
     14296+    ((SP != 0) && (pair >= 0) && (pair < SP->_pair_limit) && SP->_coloron)
     14297+
     14298 #if NCURSES_EXT_FUNCS
     14299 /*
     14300  * These are called from _nc_do_color(), which in turn is called from
     14301@@ -255,6 +262,15 @@
     14302        }
     14303 
     14304        if (max_pairs > 0 && max_colors > 0) {
     14305+           SP->_pair_limit = max_pairs;
     14306+
     14307+#if NCURSES_EXT_FUNCS
     14308+           /*
     14309+            * If using default colors, allocate extra space in table to
     14310+            * allow for default-color as a component of a color-pair.
     14311+            */
     14312+           SP->_pair_limit += (1 + (2 * max_colors));
     14313+#endif
     14314            SP->_pair_count = max_pairs;
     14315            SP->_color_count = max_colors;
     14316 #if !USE_REENTRANT
     14317@@ -263,7 +279,7 @@
     14318 #endif
     14319 
     14320            if ((SP->_color_pairs = TYPE_CALLOC(colorpair_t,
     14321-                                               max_pairs)) != 0) {
     14322+                                               SP->_pair_limit)) != 0) {
     14323                if ((SP->_color_table = TYPE_CALLOC(color_t,
     14324                                                    max_colors)) != 0) {
     14325                    SP->_color_pairs[0] = PAIR_OF(default_fg(), default_bg());
     14326@@ -331,21 +347,69 @@
     14327 init_pair(short pair, short f, short b)
     14328 {
     14329     colorpair_t result;
     14330+    colorpair_t previous;
     14331 
     14332     T((T_CALLED("init_pair(%d,%d,%d)"), pair, f, b));
     14333 
     14334-    if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron)
     14335+    if (!ValidPair(pair))
     14336        returnCode(ERR);
     14337+
     14338+    previous = SP->_color_pairs[pair];
     14339 #if NCURSES_EXT_FUNCS
     14340     if (SP->_default_color) {
     14341-       if (f < 0)
     14342+       bool isDefault = FALSE;
     14343+       bool wasDefault = FALSE;
     14344+       int default_pairs = SP->_default_pairs;
     14345+
     14346+       /*
     14347+        * Map caller's color number, e.g., -1, 0, 1, .., 7, etc., into
     14348+        * internal unsigned values which we will store in the _color_pairs[]
     14349+        * table.
     14350+        */
     14351+       if (isDefaultColor(f)) {
     14352            f = COLOR_DEFAULT;
     14353-       if (b < 0)
     14354+           isDefault = TRUE;
     14355+       } else if (!OkColorHi(f)) {
     14356+           returnCode(ERR);
     14357+       }
     14358+
     14359+       if (isDefaultColor(b)) {
     14360            b = COLOR_DEFAULT;
     14361-       if (!OkColorHi(f) && !isDefaultColor(f))
     14362+           isDefault = TRUE;
     14363+       } else if (!OkColorHi(b)) {
     14364            returnCode(ERR);
     14365-       if (!OkColorHi(b) && !isDefaultColor(b))
     14366+       }
     14367+
     14368+       /*
     14369+        * Check if the table entry that we are going to init/update used
     14370+        * default colors.
     14371+        */
     14372+       if ((FORE_OF(previous) == COLOR_DEFAULT)
     14373+           || (BACK_OF(previous) == COLOR_DEFAULT))
     14374+           wasDefault = TRUE;
     14375+
     14376+       /*
     14377+        * Keep track of the number of entries in the color pair table which
     14378+        * used a default color.
     14379+        */
     14380+       if (isDefault && !wasDefault) {
     14381+           ++default_pairs;
     14382+       } else if (wasDefault && !isDefault) {
     14383+           --default_pairs;
     14384+       }
     14385+
     14386+       /*
     14387+        * As an extension, ncurses allows the pair number to exceed the
     14388+        * terminal's color_pairs value for pairs using a default color.
     14389+        *
     14390+        * Note that updating a pair which used a default color with one
     14391+        * that does not will decrement the count - and possibly interfere
     14392+        * with sequentially adding new pairs.
     14393+        */
     14394+       if (pair > (SP->_pair_count + default_pairs)) {
     14395            returnCode(ERR);
     14396+       }
     14397+       SP->_default_pairs = default_pairs;
     14398     } else
     14399 #endif
     14400     {
     14401@@ -361,8 +425,8 @@
     14402      * pair colors with the new ones).
     14403      */
     14404     result = PAIR_OF(f, b);
     14405-    if (SP->_color_pairs[pair] != 0
     14406-       && SP->_color_pairs[pair] != result) {
     14407+    if (previous != 0
     14408+       && previous != result) {
     14409        int y, x;
     14410 
     14411        for (y = 0; y <= curscr->_maxy; y++) {
     14412@@ -496,11 +560,11 @@
     14413 
     14414     T((T_CALLED("pair_content(%d,%p,%p)"), pair, f, b));
     14415 
     14416-    if ((pair < 0) || (pair >= COLOR_PAIRS) || SP == 0 || !SP->_coloron) {
     14417+    if (!ValidPair(pair)) {
     14418        result = ERR;
     14419     } else {
     14420-       NCURSES_COLOR_T fg = ((SP->_color_pairs[pair] >> C_SHIFT) & C_MASK);
     14421-       NCURSES_COLOR_T bg = (SP->_color_pairs[pair] & C_MASK);
     14422+       NCURSES_COLOR_T fg = FORE_OF(SP->_color_pairs[pair]);
     14423+       NCURSES_COLOR_T bg = BACK_OF(SP->_color_pairs[pair]);
     14424 
     14425 #if NCURSES_EXT_FUNCS
     14426        if (fg == COLOR_DEFAULT)
     14427@@ -527,7 +591,7 @@
     14428     NCURSES_COLOR_T bg = COLOR_DEFAULT;
     14429     NCURSES_COLOR_T old_fg, old_bg;
     14430 
     14431-    if (pair < 0 || pair >= COLOR_PAIRS) {
     14432+    if (!ValidPair(pair)) {
     14433        return;
     14434     } else if (pair != 0) {
     14435        if (set_color_pair) {
     14436diff -Naur ncurses-5.7.orig/ncurses/base/lib_colorset.c ncurses-5.7/ncurses/base/lib_colorset.c
     14437--- ncurses-5.7.orig/ncurses/base/lib_colorset.c        2005-01-29 13:40:51.000000000 -0800
     14438+++ ncurses-5.7/ncurses/base/lib_colorset.c     2009-01-27 16:45:05.088820784 -0800
     14439@@ -1,5 +1,5 @@
     14440 /****************************************************************************
     14441- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
     14442+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
     14443  *                                                                          *
     14444  * Permission is hereby granted, free of charge, to any person obtaining a  *
     14445  * copy of this software and associated documentation files (the            *
     14446@@ -28,7 +28,7 @@
     14447 
     14448 /****************************************************************************
     14449  *  Author: Juergen Pfeifer,  1998                                          *
     14450- *     and: Thomas E. Dickey, 2005                                          *
     14451+ *     and: Thomas E. Dickey, 2005-on                                       *
     14452  ****************************************************************************/
     14453 
     14454 /*
     14455@@ -41,20 +41,23 @@
     14456 #include <curses.priv.h>
     14457 #include <ctype.h>
     14458 
     14459-MODULE_ID("$Id: lib_colorset.c,v 1.11 2005/01/29 21:40:51 tom Exp $")
     14460+MODULE_ID("$Id: lib_colorset.c,v 1.12 2009/01/25 00:44:40 tom Exp $")
     14461 
     14462 NCURSES_EXPORT(int)
     14463 wcolor_set(WINDOW *win, short color_pair_number, void *opts)
     14464 {
     14465+    int code = ERR;
     14466+
     14467     T((T_CALLED("wcolor_set(%p,%d)"), win, color_pair_number));
     14468     if (win
     14469        && !opts
     14470+       && (SP != 0)
     14471        && (color_pair_number >= 0)
     14472-       && (color_pair_number < COLOR_PAIRS)) {
     14473+       && (color_pair_number < SP->_pair_limit)) {
     14474        TR(TRACE_ATTRS, ("... current %ld", (long) GET_WINDOW_PAIR(win)));
     14475        SET_WINDOW_PAIR(win, color_pair_number);
     14476        if_EXT_COLORS(win->_color = color_pair_number);
     14477-       returnCode(OK);
     14478-    } else
     14479-       returnCode(ERR);
     14480+       code = OK;
     14481+    }
     14482+    returnCode(code);
     14483 }
    1447314484diff -Naur ncurses-5.7.orig/ncurses/base/lib_freeall.c ncurses-5.7/ncurses/base/lib_freeall.c
    1447414485--- ncurses-5.7.orig/ncurses/base/lib_freeall.c 2008-09-27 06:09:57.000000000 -0700
    14475 +++ ncurses-5.7/ncurses/base/lib_freeall.c      2009-01-18 23:56:25.000000000 -0800
     14486+++ ncurses-5.7/ncurses/base/lib_freeall.c      2009-01-27 16:44:49.391812822 -0800
    1447614487@@ -40,7 +40,7 @@
    1447714488 extern int malloc_errfd;       /* FIXME */
     
    1449414505diff -Naur ncurses-5.7.orig/ncurses/base/lib_mouse.c ncurses-5.7/ncurses/base/lib_mouse.c
    1449514506--- ncurses-5.7.orig/ncurses/base/lib_mouse.c   2008-10-18 14:48:55.000000000 -0700
    14496 +++ ncurses-5.7/ncurses/base/lib_mouse.c        2009-01-18 23:56:25.000000000 -0800
     14507+++ ncurses-5.7/ncurses/base/lib_mouse.c        2009-01-27 16:44:49.391812822 -0800
    1449714508@@ -79,7 +79,7 @@
    1449814509 
     
    1455114562 
    1455214563 NCURSES_EXPORT(bool)
     14564diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkatr_set.c ncurses-5.7/ncurses/base/lib_slkatr_set.c
     14565--- ncurses-5.7.orig/ncurses/base/lib_slkatr_set.c      2005-01-28 13:11:53.000000000 -0800
     14566+++ ncurses-5.7/ncurses/base/lib_slkatr_set.c   2009-01-27 16:45:05.088820784 -0800
     14567@@ -1,5 +1,5 @@
     14568 /****************************************************************************
     14569- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
     14570+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
     14571  *                                                                          *
     14572  * Permission is hereby granted, free of charge, to any person obtaining a  *
     14573  * copy of this software and associated documentation files (the            *
     14574@@ -28,7 +28,7 @@
     14575 
     14576 /****************************************************************************
     14577  *  Author:  Juergen Pfeifer, 1998                                          *
     14578- *     and:  Thomas E. Dickey 2005                                          *
     14579+ *     and:  Thomas E. Dickey 2005-on                                       *
     14580  ****************************************************************************/
     14581 
     14582 /*
     14583@@ -38,22 +38,27 @@
     14584  */
     14585 #include <curses.priv.h>
     14586 
     14587-MODULE_ID("$Id: lib_slkatr_set.c,v 1.10 2005/01/28 21:11:53 tom Exp $")
     14588+MODULE_ID("$Id: lib_slkatr_set.c,v 1.11 2009/01/25 00:47:15 tom Exp $")
     14589 
     14590 NCURSES_EXPORT(int)
     14591 slk_attr_set(const attr_t attr, short color_pair_number, void *opts)
     14592 {
     14593+    int code = ERR;
     14594+
     14595     T((T_CALLED("slk_attr_set(%s,%d)"), _traceattr(attr), color_pair_number));
     14596 
     14597-    if (SP != 0 && SP->_slk != 0 && !opts &&
     14598-       color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
     14599+    if (SP != 0
     14600+       && SP->_slk != 0
     14601+       && !opts
     14602+       && color_pair_number >= 0
     14603+       && color_pair_number < SP->_pair_limit) {
     14604        TR(TRACE_ATTRS, ("... current %s", _tracech_t(CHREF(SP->_slk->attr))));
     14605        SetAttr(SP->_slk->attr, attr);
     14606        if (color_pair_number > 0) {
     14607            SetPair(SP->_slk->attr, color_pair_number);
     14608        }
     14609        TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
     14610-       returnCode(OK);
     14611-    } else
     14612-       returnCode(ERR);
     14613+       code = OK;
     14614+    }
     14615+    returnCode(code);
     14616 }
     14617diff -Naur ncurses-5.7.orig/ncurses/base/lib_slkcolor.c ncurses-5.7/ncurses/base/lib_slkcolor.c
     14618--- ncurses-5.7.orig/ncurses/base/lib_slkcolor.c        2005-01-28 13:11:53.000000000 -0800
     14619+++ ncurses-5.7/ncurses/base/lib_slkcolor.c     2009-01-27 16:45:05.088820784 -0800
     14620@@ -1,5 +1,5 @@
     14621 /****************************************************************************
     14622- * Copyright (c) 1998-2003,2005 Free Software Foundation, Inc.              *
     14623+ * Copyright (c) 1998-2005,2009 Free Software Foundation, Inc.              *
     14624  *                                                                          *
     14625  * Permission is hereby granted, free of charge, to any person obtaining a  *
     14626  * copy of this software and associated documentation files (the            *
     14627@@ -28,7 +28,7 @@
     14628 
     14629 /****************************************************************************
     14630  *  Author:  Juergen Pfeifer, 1998                                          *
     14631- *     and:  Thomas E. Dickey 2005                                          *
     14632+ *     and:  Thomas E. Dickey 2005-on                                       *
     14633  ****************************************************************************/
     14634 
     14635 /*
     14636@@ -38,19 +38,23 @@
     14637  */
     14638 #include <curses.priv.h>
     14639 
     14640-MODULE_ID("$Id: lib_slkcolor.c,v 1.12 2005/01/28 21:11:53 tom Exp $")
     14641+MODULE_ID("$Id: lib_slkcolor.c,v 1.13 2009/01/25 00:48:07 tom Exp $")
     14642 
     14643 NCURSES_EXPORT(int)
     14644 slk_color(short color_pair_number)
     14645 {
     14646+    int code = ERR;
     14647+
     14648     T((T_CALLED("slk_color(%d)"), color_pair_number));
     14649 
     14650-    if (SP != 0 && SP->_slk != 0 &&
     14651-       color_pair_number >= 0 && color_pair_number < COLOR_PAIRS) {
     14652+    if (SP != 0
     14653+       && SP->_slk != 0
     14654+       && color_pair_number >= 0
     14655+       && color_pair_number < SP->_pair_limit) {
     14656        TR(TRACE_ATTRS, ("... current is %s", _tracech_t(CHREF(SP->_slk->attr))));
     14657        SetPair(SP->_slk->attr, color_pair_number);
     14658        TR(TRACE_ATTRS, ("new attribute is %s", _tracech_t(CHREF(SP->_slk->attr))));
     14659-       returnCode(OK);
     14660-    } else
     14661-       returnCode(ERR);
     14662+       code = OK;
     14663+    }
     14664+    returnCode(code);
     14665 }
    1455314666diff -Naur ncurses-5.7.orig/ncurses/curses.priv.h ncurses-5.7/ncurses/curses.priv.h
    1455414667--- ncurses-5.7.orig/ncurses/curses.priv.h      2008-10-04 14:37:45.000000000 -0700
    14555 +++ ncurses-5.7/ncurses/curses.priv.h   2009-01-18 23:56:21.000000000 -0800
     14668+++ ncurses-5.7/ncurses/curses.priv.h   2009-01-27 16:45:05.088820784 -0800
     14669@@ -1,5 +1,5 @@
     14670 /****************************************************************************
     14671- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
     14672+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
     14673  *                                                                          *
     14674  * Permission is hereby granted, free of charge, to any person obtaining a  *
     14675  * copy of this software and associated documentation files (the            *
    1455614676@@ -34,7 +34,7 @@
    1455714677 
     
    1455914679 /*
    1456014680- * $Id: curses.priv.h,v 1.394 2008/10/04 21:37:45 tom Exp $
    14561 + * $Id: curses.priv.h,v 1.395 2008/11/23 00:09:04 tom Exp $
     14681+ * $Id: curses.priv.h,v 1.396 2009/01/24 23:04:59 tom Exp $
    1456214682  *
    1456314683  *     curses.priv.h
    1456414684  *
    14565 @@ -1519,7 +1519,7 @@
     14685@@ -404,6 +404,8 @@
     14686 #define C_SHIFT 9              /* we need more bits than there are colors */
     14687 #define C_MASK                 ((1 << C_SHIFT) - 1)
     14688 #define PAIR_OF(fg, bg)                ((((fg) & C_MASK) << C_SHIFT) | ((bg) & C_MASK))
     14689+#define FORE_OF(c)             (((c) >> C_SHIFT) & C_MASK)
     14690+#define BACK_OF(c)             ((c) & C_MASK)
     14691 #define isDefaultColor(c)      ((c) >= COLOR_DEFAULT || (c) < 0)
     14692 
     14693 #define COLOR_DEFAULT          C_MASK
     14694@@ -794,11 +796,13 @@
     14695        int             _color_count;   /* count of colors in palette        */
     14696        colorpair_t     *_color_pairs;  /* screen's color pair list          */
     14697        int             _pair_count;    /* count of color pairs              */
     14698+       int             _pair_limit;    /* actual limit of color-pairs       */
     14699 #if NCURSES_EXT_FUNCS
     14700        bool            _default_color; /* use default colors                */
     14701        bool            _has_sgr_39_49; /* has ECMA default color support    */
     14702        int             _default_fg;    /* assumed default foreground        */
     14703        int             _default_bg;    /* assumed default background        */
     14704+       int             _default_pairs; /* count pairs using default color   */
     14705 #endif
     14706        chtype          _ok_attributes; /* valid attributes for terminal     */
     14707        chtype          _xmc_suppress;  /* attributes to suppress if xmc     */
     14708@@ -1519,7 +1523,7 @@
    1456614709 extern NCURSES_EXPORT(void) _nc_screen_wrap (void);
    1456714710 
     
    1457214715 /* lib_mvcur.c */
    1457314716 #define INFINITY       1000000 /* cost: too high to use */
     14717diff -Naur ncurses-5.7.orig/ncurses/Makefile.in ncurses-5.7/ncurses/Makefile.in
     14718--- ncurses-5.7.orig/ncurses/Makefile.in        2008-10-18 07:11:54.000000000 -0700
     14719+++ ncurses-5.7/ncurses/Makefile.in     2009-01-27 16:44:58.028366252 -0800
     14720@@ -1,6 +1,6 @@
     14721-# $Id: Makefile.in,v 1.113 2008/10/18 14:11:54 tom Exp $
     14722+# $Id: Makefile.in,v 1.114 2009/01/03 19:09:26 tom Exp $
     14723 ##############################################################################
     14724-# Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.                #
     14725+# Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.                #
     14726 #                                                                            #
     14727 # Permission is hereby granted, free of charge, to any person obtaining a    #
     14728 # copy of this software and associated documentation files (the "Software"), #
     14729@@ -78,7 +78,7 @@
     14730 INSTALL_DATA   = @INSTALL_DATA@
     14731 
     14732 AR             = @AR@
     14733-AR_OPTS                = @AR_OPTS@
     14734+ARFLAGS                = @ARFLAGS@
     14735 AWK            = @AWK@
     14736 LD             = @LD@
     14737 LN_S           = @LN_S@
    1457414738diff -Naur ncurses-5.7.orig/ncurses/tinfo/entries.c ncurses-5.7/ncurses/tinfo/entries.c
    1457514739--- ncurses-5.7.orig/ncurses/tinfo/entries.c    2008-09-27 06:11:10.000000000 -0700
    14576 +++ ncurses-5.7/ncurses/tinfo/entries.c 2009-01-18 23:56:25.000000000 -0800
     14740+++ ncurses-5.7/ncurses/tinfo/entries.c 2009-01-27 16:44:49.391812822 -0800
    1457714741@@ -37,7 +37,7 @@
    1457814742 #include <tic.h>
     
    1459614760diff -Naur ncurses-5.7.orig/ncurses/tinfo/hashed_db.c ncurses-5.7/ncurses/tinfo/hashed_db.c
    1459714761--- ncurses-5.7.orig/ncurses/tinfo/hashed_db.c  2006-08-19 12:48:38.000000000 -0700
    14598 +++ ncurses-5.7/ncurses/tinfo/hashed_db.c       2009-01-18 23:56:27.000000000 -0800
     14762+++ ncurses-5.7/ncurses/tinfo/hashed_db.c       2009-01-27 16:44:51.023917306 -0800
    1459914763@@ -1,5 +1,5 @@
    1460014764 /****************************************************************************
     
    1470014864 }
    1470114865 
     14866diff -Naur ncurses-5.7.orig/ncurses/tty/tty_update.c ncurses-5.7/ncurses/tty/tty_update.c
     14867--- ncurses-5.7.orig/ncurses/tty/tty_update.c   2008-08-30 13:08:19.000000000 -0700
     14868+++ ncurses-5.7/ncurses/tty/tty_update.c        2009-01-27 16:45:05.088820784 -0800
     14869@@ -1,5 +1,5 @@
     14870 /****************************************************************************
     14871- * Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.              *
     14872+ * Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.              *
     14873  *                                                                          *
     14874  * Permission is hereby granted, free of charge, to any person obtaining a  *
     14875  * copy of this software and associated documentation files (the            *
     14876@@ -78,7 +78,7 @@
     14877 #include <ctype.h>
     14878 #include <term.h>
     14879 
     14880-MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $")
     14881+MODULE_ID("$Id: tty_update.c,v 1.247 2009/01/25 00:48:36 tom Exp $")
     14882 
     14883 /*
     14884  * This define controls the line-breakout optimization.  Every once in a
     14885@@ -1165,8 +1165,8 @@
     14886                newPair = GetPair(newLine[n]);
     14887                if (oldPair != newPair
     14888                    && unColor(oldLine[n]) == unColor(newLine[n])) {
     14889-                   if (oldPair < COLOR_PAIRS
     14890-                       && newPair < COLOR_PAIRS
     14891+                   if (oldPair < SP->_pair_limit
     14892+                       && newPair < SP->_pair_limit
     14893                        && SP->_color_pairs[oldPair] == SP->_color_pairs[newPair]) {
     14894                        SetPair(oldLine[n], GetPair(newLine[n]));
     14895                    }
     14896diff -Naur ncurses-5.7.orig/NEWS ncurses-5.7/NEWS
     14897--- ncurses-5.7.orig/NEWS       2008-11-01 17:56:22.000000000 -0700
     14898+++ ncurses-5.7/NEWS    2009-01-27 16:45:05.084820505 -0800
     14899@@ -1,5 +1,5 @@
     14900 -------------------------------------------------------------------------------
     14901--- Copyright (c) 1998-2007,2008 Free Software Foundation, Inc.               --
     14902+-- Copyright (c) 1998-2008,2009 Free Software Foundation, Inc.               --
     14903 --                                                                           --
     14904 -- Permission is hereby granted, free of charge, to any person obtaining a   --
     14905 -- copy of this software and associated documentation files (the             --
     14906@@ -25,7 +25,7 @@
     14907 -- sale, use or other dealings in this Software without prior written        --
     14908 -- authorization.                                                            --
     14909 -------------------------------------------------------------------------------
     14910--- $Id: NEWS,v 1.1320 2008/11/02 00:56:22 tom Exp $
     14911+-- $Id: NEWS,v 1.1360 2009/01/24 23:06:51 tom Exp $
     14912 -------------------------------------------------------------------------------
     14913 
     14914 This is a log of changes that ncurses has gone through since Zeyd started
     14915@@ -45,6 +45,133 @@
     14916 Changes through 1.9.9e did not credit all contributions;
     14917 it is not possible to add this information.
     14918 
     14919+20090124
     14920+       + modify init_pair() to allow caller to create extra color pairs beyond
     14921+         the color_pairs limit, which use default colors (request by Emanuele
     14922+         Giaquinta).
     14923+       + add misc/terminfo.tmp and misc/*.pc to "sources" rule.
     14924+       + fix typo "==" where "=" is needed in ncurses-config.in and
     14925+         gen-pkgconfig.in files (Debian #512161).
     14926+
     14927+20090117
     14928+       + add -shared option to MK_SHARED_LIB when -Bsharable is used, for
     14929+         *BSD's, without which "main" might be one of the shared library's
     14930+         dependencies (report/analysis by Ken Dickey).
     14931+       + modify waddch_literal(), updating line-pointer after a multicolumn
     14932+         character is found to not fit on the current row, and wrapping is
     14933+         done.  Since the line-pointer was not updated, the wrapped
     14934+         multicolumn character was written to the beginning of the current row
     14935+         (cf: 20041023, reported by "Nick" regarding problem with ncmpc
     14936+         http://musicpd.org/mantis/bug_view_page.php?bug_id=1930).
     14937+
     14938+20090110
     14939+       + add screen.Eterm terminfo entry (GenToo #124887) -TD
     14940+       + modify adacurses-config to look for ".ali" files in the adalib
     14941+         directory.
     14942+       + correct install for Ada95, which omitted libAdaCurses.a used in
     14943+         adacurses-config
     14944+       + change install for adacurses-config to provide additional flavors
     14945+         such as adacursesw-config, for ncursesw (GenToo #167849).
     14946+
     14947+20090105
     14948+       + remove undeveloped feature in ncurses-config.in for setting
     14949+         prefix variable.
     14950+       + recent change to ncurses-config.in did not take into account the
     14951+         --disable-overwrite option, which sets $includedir to the
     14952+         subdirectory and using just that for a -I option does not work - fix
     14953+         (report by Frederic L W Meunier).
     14954+
     14955+20090104
     14956+       + modify gen-pkgconfig.in to eliminate a dependency on rpath when
     14957+         deciding whether to add $LIBS to --libs output; that should be shown
     14958+         for the ncurses and tinfo libraries without taking rpath into
     14959+         account.
     14960+       + fix an overlooked change from $AR_OPTS to $ARFLAGS in mk-1st.awk,
     14961+         used in static libraries (report by Marty Jack).
     14962+
     14963+20090103
     14964+       + add a configure-time check to pick a suitable value for
     14965+         CC_SHARED_OPTS for Solaris (report by Dagobert Michelsen).
     14966+       + add configure --with-pkg-config and --enable-pc-files options, along
     14967+         with misc/gen-pkgconfig.in which can be used to generate ".pc" files
     14968+         for pkg-config (request by Jan Engelhardt).
     14969+       + use $includedir symbol in misc/ncurses-config.in, add --includedir
     14970+         option.
     14971+       + change makefiles to use $ARFLAGS rather than $AR_OPTS, provide a
     14972+         configure check to detect whether a "-" is needed before "ar"
     14973+         options.
     14974+       + update config.guess, config.sub from
     14975+               http://savannah.gnu.org/projects/config
     14976+
     14977+20081227
     14978+       + modify mk-1st.awk to work with extra categories for tinfo library.
     14979+       + modify configure script to allow building shared libraries with gcc
     14980+         on AIX 5 or 6 (adapted from patch by Lital Natan).
     14981+
     14982+20081220
     14983+       + modify to omit the opaque-functions from lib_gen.o when
     14984+         --disable-ext-funcs is used.
     14985+       + add test/clip_printw.c to illustrate how to use printw without
     14986+         wrapping.
     14987+       + modify ncurses 'F' test to demo wborder_set() with colored lines.
     14988+       + modify ncurses 'f' test to demo wborder() with colored lines.
     14989+
     14990+20081213
     14991+       + add check for failure to open hashed-database needed for db4.6
     14992+         (GenToo #245370).
     14993+       + corrected --without-manpages option; previous change only suppressed
     14994+         the auxiliary rules install.man and uninstall.man
     14995+       + add case for FreeMINT to configure macro CF_XOPEN_SOURCE (patch from
     14996+         GenToo #250454).
     14997+       + fixes from NetBSD port at
     14998+         http://cvsweb.netbsd.org/bsdweb.cgi/pkgsrc/devel/ncurses/patches
     14999+         patch-ac (build-fix for DragonFly)
     15000+         patch-ae (use INSTALL_SCRIPT for installing misc/ncurses*-config).
     15001+       + improve configure script macros CF_HEADER_PATH and CF_LIBRARY_PATH
     15002+         by adding CFLAGS, CPPFLAGS and LDFLAGS, LIBS values to the
     15003+         search-lists.
     15004+       + correct title string for keybound manpage (patch by Frederic Culot,
     15005+         OpenBSD documentation/6019),
     15006+
     15007+20081206
     15008+       + move del_curterm() call from _nc_freeall() to _nc_leaks_tinfo() to
     15009+         work for progs/clear, progs/tabs, etc.
     15010+       + correct buffer-size after internal resizing of wide-character
     15011+         set_field_buffer(), broken in 20081018 changes (report by Mike Gran).
     15012+       + add "-i" option to test/filter.c to tell it to use initscr() rather
     15013+         than newterm(), to investigate report on comp.unix.programmer that
     15014+         ncurses would clear the screen in that case (it does not - the issue
     15015+         was xterm's alternate screen feature).
     15016+       + add check in mouse-driver to disable connection if GPM returns a
     15017+         zero, indicating that the connection is closed (Debian #506717,
     15018+         adapted from patch by Samuel Thibault).
     15019+
     15020+20081129
     15021+       + improve a workaround in adding wide-characters, when a control
     15022+         character is found.  The library (cf: 20040207) uses unctrl() to
     15023+         obtain a printable version of the control character, but was not
     15024+         passing color or video attributes.
     15025+       + improve test/ncurses.c 'a' test, using unctrl() more consistently to
     15026+         display meta-characters.
     15027+       + turn on _XOPEN_CURSES definition in curses.h
     15028+       + add eterm-color entry (report by Vincent Lefevre) -TD
     15029+       + correct use of key_name() in test/ncurses.c 'A' test, which only
     15030+         displays wide-characters, not key-codes since 20070612 (report by
     15031+         Ricardo Cantu).
     15032+
     15033+20081122
     15034+       + change _nc_has_mouse() to has_mouse(), reflect its use in C++ and
     15035+         Ada95 (patch by Juergen Pfeifer).
     15036+       + document in TO-DO an issue with Cygwin's package for GNAT (report
     15037+         by Mike Dennison).
     15038+       + improve error-checking of command-line options in "tabs" program.
     15039+
     15040+20081115
     15041+       + change several terminfo entries to make consistent use of ANSI
     15042+         clear-all-tabs -TD
     15043+       + add "tabs" program (prompted by Debian #502260).
     15044+       + add configure --without-manpages option (request by Mike Frysinger).
     15045+
     15046 20081102 5.7 release for upload to ftp.gnu.org
     15047 
     15048 20081025
    1470215049diff -Naur ncurses-5.7.orig/panel/Makefile.in ncurses-5.7/panel/Makefile.in
    1470315050--- ncurses-5.7.orig/panel/Makefile.in  2007-04-28 07:56:11.000000000 -0700
    14704 +++ ncurses-5.7/panel/Makefile.in       2009-01-18 23:56:35.000000000 -0800
     15051+++ ncurses-5.7/panel/Makefile.in       2009-01-27 16:44:58.028366252 -0800
    1470515052@@ -1,6 +1,6 @@
    1470615053-# $Id: Makefile.in,v 1.52 2007/04/28 14:56:11 tom Exp $
     
    1472315070diff -Naur ncurses-5.7.orig/progs/Makefile.in ncurses-5.7/progs/Makefile.in
    1472415071--- ncurses-5.7.orig/progs/Makefile.in  2008-09-07 06:58:55.000000000 -0700
    14725 +++ ncurses-5.7/progs/Makefile.in       2009-01-18 23:56:19.000000000 -0800
     15072+++ ncurses-5.7/progs/Makefile.in       2009-01-27 16:44:45.103540717 -0800
    1472615073@@ -1,6 +1,6 @@
    1472715074-# $Id: Makefile.in,v 1.79 2008/09/07 13:58:55 tom Exp $
     
    1478915136diff -Naur ncurses-5.7.orig/progs/modules ncurses-5.7/progs/modules
    1479015137--- ncurses-5.7.orig/progs/modules      2006-12-23 16:53:21.000000000 -0800
    14791 +++ ncurses-5.7/progs/modules   2009-01-18 23:56:19.000000000 -0800
     15138+++ ncurses-5.7/progs/modules   2009-01-27 16:44:45.103540717 -0800
    1479215139@@ -1,7 +1,7 @@
    1479315140-# $Id: modules,v 1.13 2006/12/24 00:53:21 tom Exp $
     
    1481015157diff -Naur ncurses-5.7.orig/progs/tabs.c ncurses-5.7/progs/tabs.c
    1481115158--- ncurses-5.7.orig/progs/tabs.c       1969-12-31 16:00:00.000000000 -0800
    14812 +++ ncurses-5.7/progs/tabs.c    2009-01-18 23:56:21.000000000 -0800
     15159+++ ncurses-5.7/progs/tabs.c    2009-01-27 16:44:46.515630395 -0800
    1481315160@@ -0,0 +1,506 @@
    1481415161+/****************************************************************************
     
    1531815665+    ExitProgram(rc);
    1531915666+}
     15667diff -Naur ncurses-5.7.orig/test/clip_printw.c ncurses-5.7/test/clip_printw.c
     15668--- ncurses-5.7.orig/test/clip_printw.c 1969-12-31 16:00:00.000000000 -0800
     15669+++ ncurses-5.7/test/clip_printw.c      2009-01-27 16:44:52.892037156 -0800
     15670@@ -0,0 +1,360 @@
     15671+/****************************************************************************
     15672+ * Copyright (c) 2008 Free Software Foundation, Inc.                        *
     15673+ *                                                                          *
     15674+ * Permission is hereby granted, free of charge, to any person obtaining a  *
     15675+ * copy of this software and associated documentation files (the            *
     15676+ * "Software"), to deal in the Software without restriction, including      *
     15677+ * without limitation the rights to use, copy, modify, merge, publish,      *
     15678+ * distribute, distribute with modifications, sublicense, and/or sell       *
     15679+ * copies of the Software, and to permit persons to whom the Software is    *
     15680+ * furnished to do so, subject to the following conditions:                 *
     15681+ *                                                                          *
     15682+ * The above copyright notice and this permission notice shall be included  *
     15683+ * in all copies or substantial portions of the Software.                   *
     15684+ *                                                                          *
     15685+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
     15686+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
     15687+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
     15688+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
     15689+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
     15690+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
     15691+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
     15692+ *                                                                          *
     15693+ * Except as contained in this notice, the name(s) of the above copyright   *
     15694+ * holders shall not be used in advertising or otherwise to promote the     *
     15695+ * sale, use or other dealings in this Software without prior written       *
     15696+ * authorization.                                                           *
     15697+ ****************************************************************************/
     15698+/*
     15699+ * $Id: clip_printw.c,v 1.1 2008/12/20 21:03:06 tom Exp $
     15700+ *
     15701+ * demonstrate how to use printw without wrapping.
     15702+ */
     15703+
     15704+#include <test.priv.h>
     15705+
     15706+#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
     15707+#define COLOR_DEFAULT (-1)
     15708+
     15709+typedef struct {
     15710+    unsigned c;
     15711+    unsigned v;
     15712+    int status;
     15713+    int pair;
     15714+    unsigned attr;
     15715+    int count;
     15716+    int ch;
     15717+    const char *c_msg;
     15718+    const char *v_msg;
     15719+    int y_val;
     15720+    int x_val;
     15721+    int y_beg, x_beg;
     15722+    int y_max, x_max;
     15723+} STATUS;
     15724+
     15725+static int
     15726+clip_wprintw(WINDOW *win, const char *fmt,...)
     15727+{
     15728+    int y0, x0, y1, x1, width;
     15729+    WINDOW *sub;
     15730+    va_list ap;
     15731+    int rc;
     15732+
     15733+    /*
     15734+     * Allocate a single-line derived window extending from the current
     15735+     * cursor position to the end of the current line in the given window.
     15736+     * Disable scrolling in the derived window.
     15737+     */
     15738+    getyx(win, y0, x0);
     15739+    width = getmaxx(win) - x0;
     15740+    sub = derwin(win, 1, width, y0, x0);
     15741+    scrollok(sub, FALSE);
     15742+
     15743+    /*
     15744+     * Print the text.
     15745+     */
     15746+    va_start(ap, fmt);
     15747+    rc = vw_printw(sub, fmt, ap);
     15748+    va_end(ap);
     15749+
     15750+    getyx(sub, y1, x1);
     15751+    delwin(sub);
     15752+
     15753+    wmove(win, y1 + y0, x1 + x0);
     15754+
     15755+    return rc;
     15756+}
     15757+
     15758+static const char *
     15759+color_params(unsigned state, int *pair)
     15760+{
     15761+    /* *INDENT-OFF* */
     15762+    static struct {
     15763+       int pair;
     15764+       int fg, bg;
     15765+       const char *msg;
     15766+    } table[] = {
     15767+       { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
     15768+       { 1, COLOR_RED,     COLOR_BLACK,   "red/black" },
     15769+       { 2, COLOR_WHITE,   COLOR_BLUE,    "white/blue" },
     15770+    };
     15771+    /* *INDENT-ON* */
     15772+
     15773+    static bool first = TRUE;
     15774+    const char *result = 0;
     15775+
     15776+    if (has_colors()) {
     15777+       if (first) {
     15778+           unsigned n;
     15779+
     15780+           start_color();
     15781+           for (n = 0; n < SIZEOF(table); ++n) {
     15782+               init_pair(table[n].pair, table[n].fg, table[n].bg);
     15783+           }
     15784+       }
     15785+       if (state < SIZEOF(table)) {
     15786+           *pair = table[state].pair;
     15787+           result = table[state].msg;
     15788+       }
     15789+    }
     15790+    return result;
     15791+}
     15792+
     15793+static const char *
     15794+video_params(unsigned state, unsigned *attr)
     15795+{
     15796+    /* *INDENT-OFF* */
     15797+    static struct {
     15798+       unsigned attr;
     15799+       const char *msg;
     15800+    } table[] = {
     15801+       { A_NORMAL,     "normal" },
     15802+       { A_BOLD,       "bold" },
     15803+       { A_REVERSE,    "reverse" },
     15804+       { A_UNDERLINE,  "underline" },
     15805+       { A_BLINK,      "blink" },
     15806+    };
     15807+    /* *INDENT-ON* */
     15808+
     15809+    const char *result = 0;
     15810+
     15811+    if (state < SIZEOF(table)) {
     15812+       *attr = table[state].attr;
     15813+       result = table[state].msg;
     15814+    }
     15815+    return result;
     15816+}
     15817+
     15818+/* fill the window with a test-pattern */
     15819+static void
     15820+fill_window(WINDOW *win)
     15821+{
     15822+    int y, x;
     15823+
     15824+    getyx(win, y, x);
     15825+    wmove(win, 0, 0);
     15826+    while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) {
     15827+    }
     15828+    wmove(win, y, x);
     15829+}
     15830+
     15831+static void
     15832+show_status(WINDOW *win, STATUS * sp)
     15833+{
     15834+    int y, x;
     15835+
     15836+    getyx(win, y, x);
     15837+    wmove(win, 0, 0);
     15838+    wprintw(win, "Count %d", sp->count);
     15839+    if (sp->v_msg != 0)
     15840+       wprintw(win, " Video %s", sp->v_msg);
     15841+    if (sp->c_msg != 0)
     15842+       wprintw(win, " Color %s", sp->c_msg);
     15843+    wprintw(win, " (%d)", sp->status);
     15844+    wclrtoeol(win);
     15845+    wmove(win, y, x);
     15846+}
     15847+
     15848+static void
     15849+do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
     15850+{
     15851+    WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2,
     15852+                         sp->y_beg + 1, sp->x_beg + 1);
     15853+
     15854+    if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) {
     15855+       WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1);
     15856+
     15857+       if (win2 != 0) {
     15858+           box(win1, 0, 0);
     15859+           wrefresh(win1);
     15860+           func(win2);
     15861+
     15862+           delwin(win2);
     15863+       } else {
     15864+           beep();
     15865+       }
     15866+       delwin(win1);
     15867+       touchwin(win);
     15868+    } else {
     15869+       beep();
     15870+    }
     15871+}
     15872+
     15873+static void
     15874+init_status(WINDOW *win, STATUS * sp)
     15875+{
     15876+    memset(sp, 0, sizeof(*sp));
     15877+    sp->c = 99;
     15878+    sp->v = 99;
     15879+    sp->ch = ' ';
     15880+
     15881+    keypad(win, TRUE);
     15882+    fill_window(win);
     15883+
     15884+    getbegyx(win, sp->y_beg, sp->x_beg);
     15885+    getmaxyx(win, sp->y_max, sp->x_max);
     15886+}
     15887+
     15888+static void
     15889+show_help(WINDOW *win)
     15890+{
     15891+    static const char *table[] =
     15892+    {
     15893+       "Basic commands:"
     15894+       ,"Use h/j/k/l or arrow keys to move the cursor."
     15895+       ,"Set the count parameter for clip_wprintw by entering digits 0-9."
     15896+       ,""
     15897+       ,"Other commands:"
     15898+       ,"space toggles through the set of video attributes and colors."
     15899+       ,"t     touches (forces repaint) of the current line."
     15900+       ,".     calls clip_wprintw at the current position with the given count."
     15901+       ,"=     resets count to zero."
     15902+       ,"?     shows this help-window"
     15903+       ,""
     15904+    };
     15905+
     15906+    int y_max, x_max;
     15907+    int row;
     15908+
     15909+    getmaxyx(win, y_max, x_max);
     15910+    for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
     15911+       mvwprintw(win, row, 0, "%.*s", x_max, table[row]);
     15912+    }
     15913+    while (wgetch(win) != 'q')
     15914+       beep();
     15915+}
     15916+
     15917+static void
     15918+update_status(WINDOW *win, STATUS * sp)
     15919+{
     15920+    switch (sp->ch) {
     15921+    case ' ':                  /* next test-iteration */
     15922+       if (has_colors()) {
     15923+           if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) {
     15924+               sp->c_msg = color_params(sp->c = 0, &(sp->pair));
     15925+               if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
     15926+                   sp->v_msg = video_params(sp->v = 0, &(sp->attr));
     15927+               }
     15928+           }
     15929+       } else {
     15930+           if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
     15931+               sp->v_msg = video_params(sp->v = 0, &(sp->attr));
     15932+           }
     15933+       }
     15934+       sp->count = 0;
     15935+       show_status(win, sp);
     15936+       break;
     15937+    case KEY_LEFT:
     15938+    case 'h':
     15939+       if (sp->x_val > 0)
     15940+           wmove(win, sp->y_val, --(sp->x_val));
     15941+       break;
     15942+    case KEY_DOWN:
     15943+    case 'j':
     15944+       if (sp->y_val < sp->y_max)
     15945+           wmove(win, ++(sp->y_val), sp->x_val);
     15946+       break;
     15947+    case KEY_UP:
     15948+    case 'k':
     15949+       if (sp->y_val > 0)
     15950+           wmove(win, --(sp->y_val), sp->x_val);
     15951+       break;
     15952+    case KEY_RIGHT:
     15953+    case 'l':
     15954+       if (sp->x_val < sp->x_max)
     15955+           wmove(win, sp->y_val, ++(sp->x_val));
     15956+       break;
     15957+    case 't':
     15958+       touchline(win, sp->y_val, 1);
     15959+       break;
     15960+    case '=':
     15961+       sp->count = 0;
     15962+       show_status(win, sp);
     15963+       break;
     15964+    case '?':
     15965+       do_subwindow(win, sp, show_help);
     15966+       break;
     15967+    default:
     15968+       if (isdigit(sp->ch)) {
     15969+           sp->count = (sp->count * 10) + (sp->ch - '0');
     15970+           show_status(win, sp);
     15971+       } else {
     15972+           beep();
     15973+       }
     15974+       break;
     15975+    }
     15976+}
     15977+
     15978+static void
     15979+test_clipping(WINDOW *win)
     15980+{
     15981+    STATUS st;
     15982+    char fmt[80];
     15983+    char *buffer;
     15984+    unsigned j, need;
     15985+
     15986+    init_status(win, &st);
     15987+
     15988+    do {
     15989+       switch (st.ch) {
     15990+       case '.':               /* change from current position */
     15991+           wattrset(win, st.attr | COLOR_PAIR(st.pair));
     15992+           if (st.count > 0) {
     15993+               need = st.count + 1;
     15994+               sprintf(fmt, "%%c%%%ds%%c", st.count);
     15995+           } else {
     15996+               need = getmaxx(win) - 1;
     15997+               strcpy(fmt, "%c%s%c");
     15998+           }
     15999+           if ((buffer = typeMalloc(char, need)) != 0) {
     16000+               for (j = 0; j < need; ++j) {
     16001+                   buffer[j] = 'A' + (j % 26);
     16002+               }
     16003+               buffer[need - 1] = '\0';
     16004+               st.status = clip_wprintw(win, fmt, '[', buffer, ']');
     16005+           }
     16006+           break;
     16007+       case 'w':
     16008+           do_subwindow(win, &st, test_clipping);
     16009+           break;
     16010+       case 'q':
     16011+           return;
     16012+       default:
     16013+           update_status(win, &st);
     16014+           break;
     16015+       }
     16016+    } while ((st.ch = wgetch(win)) != ERR);
     16017+}
     16018+
     16019+int
     16020+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
     16021+{
     16022+    initscr();
     16023+    cbreak();
     16024+    noecho();
     16025+
     16026+    test_clipping(stdscr);
     16027+    endwin();
     16028+
     16029+    ExitProgram(EXIT_SUCCESS);
     16030+}
     16031diff -Naur ncurses-5.7.orig/test/demo_forms.c ncurses-5.7/test/demo_forms.c
     16032--- ncurses-5.7.orig/test/demo_forms.c  2008-10-18 13:38:20.000000000 -0700
     16033+++ ncurses-5.7/test/demo_forms.c       2009-01-27 16:44:52.892037156 -0800
     16034@@ -26,7 +26,7 @@
     16035  * authorization.                                                           *
     16036  ****************************************************************************/
     16037 /*
     16038- * $Id: demo_forms.c,v 1.30 2008/10/18 20:38:20 tom Exp $
     16039+ * $Id: demo_forms.c,v 1.31 2008/12/20 19:23:00 tom Exp $
     16040  *
     16041  * Demonstrate a variety of functions from the form library.
     16042  * Thomas Dickey - 2003/4/26
     16043@@ -97,6 +97,8 @@
     16044     FIELD *f = new_field(rows, cols, frow, fcol, o_value, 1);
     16045 
     16046     if (f) {
     16047+       FieldAttrs *ptr;
     16048+
     16049        set_field_back(f, A_UNDERLINE);
     16050        /*
     16051         * If -j and -d options are combined, -j loses.  It is documented in
     16052@@ -122,7 +124,12 @@
     16053        /*
     16054         * The userptr is used in edit_field.c's inactive_field().
     16055         */
     16056-       set_field_userptr(f, (void *) (long) field_back(f));
     16057+       ptr = (FieldAttrs *) field_userptr(f);
     16058+       if (ptr == 0) {
     16059+           ptr = typeCalloc(FieldAttrs, 1);
     16060+           ptr->background = field_back(f);
     16061+       }
     16062+       set_field_userptr(f, (void *) ptr);
     16063        if (t_value)
     16064            set_field_buffer(f, 0, t_value);
     16065     }
     16066diff -Naur ncurses-5.7.orig/test/edit_field.c ncurses-5.7/test/edit_field.c
     16067--- ncurses-5.7.orig/test/edit_field.c  2008-10-18 13:40:20.000000000 -0700
     16068+++ ncurses-5.7/test/edit_field.c       2009-01-27 16:44:52.892037156 -0800
     16069@@ -26,7 +26,7 @@
     16070  * authorization.                                                           *
     16071  ****************************************************************************/
     16072 /*
     16073- * $Id: edit_field.c,v 1.14 2008/10/18 20:40:20 tom Exp $
     16074+ * $Id: edit_field.c,v 1.15 2008/12/20 19:23:01 tom Exp $
     16075  *
     16076  * A wrapper for form_driver() which keeps track of the user's editing changes
     16077  * for each field, and makes the result available as a null-terminated string
     16078@@ -294,8 +294,8 @@
     16079 static void
     16080 inactive_field(FIELD * f)
     16081 {
     16082-    void *ptr = field_userptr(f);
     16083-    set_field_back(f, (chtype) ptr);
     16084+    FieldAttrs *ptr = (FieldAttrs *) field_userptr(f);
     16085+    set_field_back(f, ptr->background);
     16086 }
     16087 
     16088 int
     16089diff -Naur ncurses-5.7.orig/test/edit_field.h ncurses-5.7/test/edit_field.h
     16090--- ncurses-5.7.orig/test/edit_field.h  2006-06-03 09:38:57.000000000 -0700
     16091+++ ncurses-5.7/test/edit_field.h       2009-01-27 16:44:52.896037435 -0800
     16092@@ -1,5 +1,5 @@
     16093 /****************************************************************************
     16094- * Copyright (c) 2003-2004,2005 Free Software Foundation, Inc.              *
     16095+ * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc.              *
     16096  *                                                                          *
     16097  * Permission is hereby granted, free of charge, to any person obtaining a  *
     16098  * copy of this software and associated documentation files (the            *
     16099@@ -26,7 +26,7 @@
     16100  * authorization.                                                           *
     16101  ****************************************************************************/
     16102 /*
     16103- * $Id: edit_field.h,v 1.5 2006/06/03 16:38:57 tom Exp $
     16104+ * $Id: edit_field.h,v 1.6 2008/12/20 19:23:18 tom Exp $
     16105  *
     16106  * Interface of edit_field.c
     16107  */
     16108@@ -43,6 +43,10 @@
     16109 #define MY_EDT_MODE    EDIT_FIELD('e')
     16110 #define MY_INS_MODE    EDIT_FIELD('t')
     16111 
     16112+typedef struct {
     16113+    chtype background;
     16114+} FieldAttrs;
     16115+
     16116 extern void help_edit_field(void);
     16117 extern int edit_field(FORM * form, int *result);
     16118 
     16119diff -Naur ncurses-5.7.orig/test/filter.c ncurses-5.7/test/filter.c
     16120--- ncurses-5.7.orig/test/filter.c      2006-12-09 08:53:47.000000000 -0800
     16121+++ ncurses-5.7/test/filter.c   2009-01-27 16:44:49.391812822 -0800
     16122@@ -1,5 +1,5 @@
     16123 /****************************************************************************
     16124- * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
     16125+ * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
     16126  *                                                                          *
     16127  * Permission is hereby granted, free of charge, to any person obtaining a  *
     16128  * copy of this software and associated documentation files (the            *
     16129@@ -29,7 +29,7 @@
     16130 /*
     16131  * Author:  Thomas E. Dickey <dickey@clark.net> 1998
     16132  *
     16133- * $Id: filter.c,v 1.11 2006/12/09 16:53:47 tom Exp $
     16134+ * $Id: filter.c,v 1.12 2008/12/06 21:59:27 tom Exp $
     16135  */
     16136 #include <test.priv.h>
     16137 
     16138@@ -78,16 +78,50 @@
     16139     return code;
     16140 }
     16141 
     16142+static void
     16143+usage(void)
     16144+{
     16145+    static const char *msg[] =
     16146+    {
     16147+       "Usage: filter [options]"
     16148+       ,""
     16149+       ,"Options:"
     16150+       ,"  -i   use initscr() rather than newterm()"
     16151+    };
     16152+    unsigned n;
     16153+    for (n = 0; n < SIZEOF(msg); n++)
     16154+       fprintf(stderr, "%s\n", msg[n]);
     16155+    ExitProgram(EXIT_FAILURE);
     16156+}
     16157+
     16158 int
     16159-main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
     16160+main(int argc, char *argv[])
     16161 {
     16162+    int ch;
     16163     char buffer[80];
     16164     attr_t underline;
     16165+    bool i_option = FALSE;
     16166 
     16167     setlocale(LC_ALL, "");
     16168 
     16169+    while ((ch = getopt(argc, argv, "i")) != -1) {
     16170+       switch (ch) {
     16171+       case 'i':
     16172+           i_option = TRUE;
     16173+           break;
     16174+       default:
     16175+           usage();
     16176+       }
     16177+    }
     16178+
     16179+    printf("starting filter program using %s...\n",
     16180+          i_option ? "initscr" : "newterm");
     16181     filter();
     16182-    (void) newterm((char *) 0, stdout, stdin);
     16183+    if (i_option) {
     16184+       initscr();
     16185+    } else {
     16186+       (void) newterm((char *) 0, stdout, stdin);
     16187+    }
     16188     cbreak();
     16189     keypad(stdscr, TRUE);
     16190 
     16191diff -Naur ncurses-5.7.orig/test/insdelln.c ncurses-5.7/test/insdelln.c
     16192--- ncurses-5.7.orig/test/insdelln.c    1969-12-31 16:00:00.000000000 -0800
     16193+++ ncurses-5.7/test/insdelln.c 2009-01-27 16:44:52.896037435 -0800
     16194@@ -0,0 +1,380 @@
     16195+/****************************************************************************
     16196+ * Copyright (c) 2008 Free Software Foundation, Inc.                        *
     16197+ *                                                                          *
     16198+ * Permission is hereby granted, free of charge, to any person obtaining a  *
     16199+ * copy of this software and associated documentation files (the            *
     16200+ * "Software"), to deal in the Software without restriction, including      *
     16201+ * without limitation the rights to use, copy, modify, merge, publish,      *
     16202+ * distribute, distribute with modifications, sublicense, and/or sell       *
     16203+ * copies of the Software, and to permit persons to whom the Software is    *
     16204+ * furnished to do so, subject to the following conditions:                 *
     16205+ *                                                                          *
     16206+ * The above copyright notice and this permission notice shall be included  *
     16207+ * in all copies or substantial portions of the Software.                   *
     16208+ *                                                                          *
     16209+ * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
     16210+ * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
     16211+ * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
     16212+ * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
     16213+ * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
     16214+ * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
     16215+ * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
     16216+ *                                                                          *
     16217+ * Except as contained in this notice, the name(s) of the above copyright   *
     16218+ * holders shall not be used in advertising or otherwise to promote the     *
     16219+ * sale, use or other dealings in this Software without prior written       *
     16220+ * authorization.                                                           *
     16221+ ****************************************************************************/
     16222+/*
     16223+ * $Id: insdelln.c,v 1.1 2008/12/20 22:06:52 tom Exp $
     16224+ *
     16225+ * test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln
     16226+ */
     16227+
     16228+#include <test.priv.h>
     16229+
     16230+#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
     16231+#define COLOR_DEFAULT (-1)
     16232+
     16233+typedef struct {
     16234+    unsigned c;
     16235+    unsigned v;
     16236+    int pair;
     16237+    unsigned attr;
     16238+    int count;
     16239+    int ch;
     16240+    const char *c_msg;
     16241+    const char *v_msg;
     16242+    int y_val;
     16243+    int x_val;
     16244+    int y_beg, x_beg;
     16245+    int y_max, x_max;
     16246+} STATUS;
     16247+
     16248+static const char *
     16249+color_params(unsigned state, int *pair)
     16250+{
     16251+    /* *INDENT-OFF* */
     16252+    static struct {
     16253+       int pair;
     16254+       int fg, bg;
     16255+       const char *msg;
     16256+    } table[] = {
     16257+       { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
     16258+       { 1, COLOR_RED,     COLOR_BLACK,   "red/black" },
     16259+       { 2, COLOR_WHITE,   COLOR_BLUE,    "white/blue" },
     16260+    };
     16261+    /* *INDENT-ON* */
     16262+
     16263+    static bool first = TRUE;
     16264+    const char *result = 0;
     16265+
     16266+    if (has_colors()) {
     16267+       if (first) {
     16268+           unsigned n;
     16269+
     16270+           start_color();
     16271+           for (n = 0; n < SIZEOF(table); ++n) {
     16272+               init_pair(table[n].pair, table[n].fg, table[n].bg);
     16273+           }
     16274+       }
     16275+       if (state < SIZEOF(table)) {
     16276+           *pair = table[state].pair;
     16277+           result = table[state].msg;
     16278+       }
     16279+    }
     16280+    return result;
     16281+}
     16282+
     16283+static const char *
     16284+video_params(unsigned state, unsigned *attr)
     16285+{
     16286+    /* *INDENT-OFF* */
     16287+    static struct {
     16288+       unsigned attr;
     16289+       const char *msg;
     16290+    } table[] = {
     16291+       { A_NORMAL,     "normal" },
     16292+       { A_BOLD,       "bold" },
     16293+       { A_REVERSE,    "reverse" },
     16294+       { A_UNDERLINE,  "underline" },
     16295+       { A_BLINK,      "blink" },
     16296+    };
     16297+    /* *INDENT-ON* */
     16298+
     16299+    const char *result = 0;
     16300+
     16301+    if (state < SIZEOF(table)) {
     16302+       *attr = table[state].attr;
     16303+       result = table[state].msg;
     16304+    }
     16305+    return result;
     16306+}
     16307+
     16308+/* fill the window with a test-pattern */
     16309+static void
     16310+fill_window(WINDOW *win)
     16311+{
     16312+    int y, x;
     16313+
     16314+    getyx(win, y, x);
     16315+    wmove(win, 1, 0);
     16316+    while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) {
     16317+    }
     16318+    wmove(win, y, x);
     16319+}
     16320+
     16321+static void
     16322+show_status(WINDOW *win, STATUS * sp)
     16323+{
     16324+    int y, x;
     16325+
     16326+    getyx(win, y, x);
     16327+    wmove(win, 0, 0);
     16328+    wprintw(win, "Count %d", sp->count);
     16329+    if (sp->v_msg != 0)
     16330+       wprintw(win, " Video %s", sp->v_msg);
     16331+    if (sp->c_msg != 0)
     16332+       wprintw(win, " Color %s", sp->c_msg);
     16333+    wclrtoeol(win);
     16334+    wmove(win, y, x);
     16335+}
     16336+
     16337+static void
     16338+reshow_status(WINDOW *win, STATUS * sp)
     16339+{
     16340+    fill_window(win);
     16341+    show_status(win, sp);
     16342+}
     16343+
     16344+static void
     16345+do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
     16346+{
     16347+    WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2,
     16348+                         sp->y_beg + 1, sp->x_beg + 1);
     16349+
     16350+    if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) {
     16351+       WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1);
     16352+
     16353+       if (win2 != 0) {
     16354+           box(win1, 0, 0);
     16355+           wrefresh(win1);
     16356+           func(win2);
     16357+
     16358+           delwin(win2);
     16359+       } else {
     16360+           beep();
     16361+       }
     16362+       delwin(win1);
     16363+       touchwin(win);
     16364+    } else {
     16365+       beep();
     16366+    }
     16367+}
     16368+
     16369+static void
     16370+init_status(WINDOW *win, STATUS * sp)
     16371+{
     16372+    memset(sp, 0, sizeof(*sp));
     16373+    sp->c = 99;
     16374+    sp->v = 99;
     16375+    sp->ch = ' ';
     16376+
     16377+    keypad(win, TRUE);
     16378+    fill_window(win);
     16379+
     16380+    getbegyx(win, sp->y_beg, sp->x_beg);
     16381+    getmaxyx(win, sp->y_max, sp->x_max);
     16382+}
     16383+
     16384+static void
     16385+show_help(WINDOW *win)
     16386+{
     16387+    static const char *table[] =
     16388+    {
     16389+       "Basic commands:"
     16390+       ,"Use h/j/k/l or arrow keys to move the cursor."
     16391+       ,"Set the count parameter for insert/delete by entering digits 0-9."
     16392+       ,""
     16393+       ,"Other commands:"
     16394+       ,"space toggles through the set of video attributes and colors."
     16395+       ,"t     touches (forces repaint) of the current line."
     16396+       ,"i     calls insertln at the current position with the given count."
     16397+       ,"d     calls deleteln at the window beginning with the given count."
     16398+       ,"I     calls insdelln at the window beginning with the given count."
     16399+       ,"D     calls insdelln at the window beginning with the given -count."
     16400+       ,"f     refills the window with test-pattern using current attributes."
     16401+       ,"w     recur to test windows other than stdscr"
     16402+       ,"q     quit"
     16403+       ,"=     resets count to zero."
     16404+       ,"?     shows this help-window"
     16405+       ,""
     16406+       ,""
     16407+    };
     16408+
     16409+    int y_max, x_max;
     16410+    int row;
     16411+
     16412+    getmaxyx(win, y_max, x_max);
     16413+    for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
     16414+       mvwprintw(win, row, 0, "%.*s", x_max, table[row]);
     16415+    }
     16416+    while (wgetch(win) != 'q')
     16417+       beep();
     16418+}
     16419+
     16420+static void
     16421+update_status(WINDOW *win, STATUS * sp)
     16422+{
     16423+    switch (sp->ch) {
     16424+    case ' ':                  /* next test-iteration */
     16425+       if (has_colors()) {
     16426+           if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) {
     16427+               sp->c_msg = color_params(sp->c = 0, &(sp->pair));
     16428+               if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
     16429+                   sp->v_msg = video_params(sp->v = 0, &(sp->attr));
     16430+               }
     16431+           }
     16432+       } else {
     16433+           if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
     16434+               sp->v_msg = video_params(sp->v = 0, &(sp->attr));
     16435+           }
     16436+       }
     16437+       sp->count = 0;
     16438+       show_status(win, sp);
     16439+       break;
     16440+    case KEY_LEFT:
     16441+    case 'h':
     16442+       if (sp->x_val > 0)
     16443+           wmove(win, sp->y_val, --(sp->x_val));
     16444+       break;
     16445+    case KEY_DOWN:
     16446+    case 'j':
     16447+       if (sp->y_val < sp->y_max)
     16448+           wmove(win, ++(sp->y_val), sp->x_val);
     16449+       break;
     16450+    case KEY_UP:
     16451+    case 'k':
     16452+       if (sp->y_val > 0)
     16453+           wmove(win, --(sp->y_val), sp->x_val);
     16454+       break;
     16455+    case KEY_RIGHT:
     16456+    case 'l':
     16457+       if (sp->x_val < sp->x_max)
     16458+           wmove(win, sp->y_val, ++(sp->x_val));
     16459+       break;
     16460+    case 't':
     16461+       touchline(win, sp->y_val, 1);
     16462+       break;
     16463+    case '=':
     16464+       sp->count = 0;
     16465+       show_status(win, sp);
     16466+       break;
     16467+    case '?':
     16468+       do_subwindow(win, sp, show_help);
     16469+       break;
     16470+    default:
     16471+       if (isdigit(sp->ch)) {
     16472+           sp->count = (sp->count * 10) + (sp->ch - '0');
     16473+           show_status(win, sp);
     16474+       } else {
     16475+           beep();
     16476+       }
     16477+       break;
     16478+    }
     16479+}
     16480+
     16481+static void
     16482+test_winsdelln(WINDOW *win)
     16483+{
     16484+    STATUS st;
     16485+    int n;
     16486+
     16487+    init_status(win, &st);
     16488+
     16489+    do {
     16490+       wattrset(win, st.attr | COLOR_PAIR(st.pair));
     16491+       switch (st.ch) {
     16492+       case 'i':
     16493+           for (n = 0; n < st.count; ++n)
     16494+               winsertln(win);
     16495+           break;
     16496+       case 'd':
     16497+           for (n = 0; n < st.count; ++n)
     16498+               wdeleteln(win);
     16499+           break;
     16500+       case 'I':
     16501+           winsdelln(win, st.count);
     16502+           break;
     16503+       case 'D':
     16504+           winsdelln(win, -st.count);
     16505+           break;
     16506+       case 'f':
     16507+           fill_window(win);
     16508+           reshow_status(win, &st);
     16509+           break;
     16510+       case 'w':
     16511+           do_subwindow(win, &st, test_winsdelln);
     16512+           break;
     16513+       case 'q':
     16514+           return;
     16515+       default:
     16516+           update_status(win, &st);
     16517+           break;
     16518+       }
     16519+    } while ((st.ch = wgetch(win)) != ERR);
     16520+}
     16521+
     16522+static void
     16523+test_insdelln(void)
     16524+{
     16525+    STATUS st;
     16526+    int n;
     16527+
     16528+    init_status(stdscr, &st);
     16529+
     16530+    do {
     16531+       attrset(st.attr | COLOR_PAIR(st.pair));
     16532+       switch (st.ch) {
     16533+       case 'i':
     16534+           for (n = 0; n < st.count; ++n)
     16535+               insertln();
     16536+           break;
     16537+       case 'd':
     16538+           for (n = 0; n < st.count; ++n)
     16539+               deleteln();
     16540+           break;
     16541+       case 'I':
     16542+           insdelln(st.count);
     16543+           break;
     16544+       case 'D':
     16545+           insdelln(-st.count);
     16546+           break;
     16547+       case 'f':
     16548+           fill_window(stdscr);
     16549+           reshow_status(stdscr, &st);
     16550+           break;
     16551+       case 'w':
     16552+           do_subwindow(stdscr, &st, test_winsdelln);
     16553+           break;
     16554+       case 'q':
     16555+           return;
     16556+       default:
     16557+           update_status(stdscr, &st);
     16558+           break;
     16559+       }
     16560+    } while ((st.ch = getch()) != ERR);
     16561+}
     16562+
     16563+int
     16564+main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
     16565+{
     16566+    initscr();
     16567+    cbreak();
     16568+    noecho();
     16569+
     16570+    test_insdelln();
     16571+    endwin();
     16572+
     16573+    ExitProgram(EXIT_SUCCESS);
     16574+}
     16575diff -Naur ncurses-5.7.orig/test/modules ncurses-5.7/test/modules
     16576--- ncurses-5.7.orig/test/modules       2007-08-18 10:57:08.000000000 -0700
     16577+++ ncurses-5.7/test/modules    2009-01-27 16:44:52.896037435 -0800
     16578@@ -1,4 +1,4 @@
     16579-# $Id: modules,v 1.36 2007/08/18 17:57:08 tom Exp $
     16580+# $Id: modules,v 1.37 2008/12/20 21:38:44 tom Exp $
     16581 ##############################################################################
     16582 # Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
     16583 #                                                                            #
     16584@@ -37,6 +37,7 @@
     16585 bs             progs           $(srcdir)       $(HEADER_DEPS)
     16586 cardfile       progs           $(srcdir)       $(HEADER_DEPS)  ../include/panel.h ../include/form.h
     16587 chgat          progs           $(srcdir)       $(HEADER_DEPS)
     16588+clip_printw    progs           $(srcdir)       $(HEADER_DEPS)
     16589 color_set      progs           $(srcdir)       $(HEADER_DEPS)
     16590 demo_altkeys   progs           $(srcdir)       $(HEADER_DEPS)
     16591 demo_defkey    progs           $(srcdir)       $(HEADER_DEPS)
     16592@@ -60,6 +61,7 @@
     16593 inch_wide      progs           $(srcdir)       $(HEADER_DEPS)
     16594 inchs          progs           $(srcdir)       $(HEADER_DEPS)
     16595 ins_wide       progs           $(srcdir)       $(HEADER_DEPS)
     16596+insdelln       progs           $(srcdir)       $(HEADER_DEPS)
     16597 inserts                progs           $(srcdir)       $(HEADER_DEPS)
     16598 key_names      progs           $(srcdir)       $(HEADER_DEPS)
     16599 keynames       progs           $(srcdir)       $(HEADER_DEPS)
     16600diff -Naur ncurses-5.7.orig/test/ncurses.c ncurses-5.7/test/ncurses.c
     16601--- ncurses-5.7.orig/test/ncurses.c     2008-09-27 07:34:58.000000000 -0700
     16602+++ ncurses-5.7/test/ncurses.c  2009-01-27 16:45:05.092821064 -0800
     16603@@ -40,7 +40,7 @@
     16604    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
     16605            Thomas E. Dickey (beginning revision 1.27 in 1996).
     16606 
     16607-$Id: ncurses.c,v 1.329 2008/09/27 14:34:58 tom Exp $
     16608+$Id: ncurses.c,v 1.336 2009/01/25 00:39:14 tom Exp $
     16609 
     16610 ***************************************************************************/
     16611 
     16612@@ -569,8 +569,11 @@
     16613  *
     16614  ****************************************************************************/
     16615 
     16616+#define NUM_GETCH_FLAGS 256
     16617+typedef bool GetchFlags[NUM_GETCH_FLAGS];
     16618+
     16619 static void
     16620-setup_getch(WINDOW *win, bool flags[])
     16621+setup_getch(WINDOW *win, GetchFlags flags)
     16622 {
     16623     keypad(win, flags['k']);   /* should be redundant, but for testing */
     16624     meta(win, flags['m']);     /* force this to a known state */
     16625@@ -581,7 +584,17 @@
     16626 }
     16627 
     16628 static void
     16629-wgetch_help(WINDOW *win, bool flags[])
     16630+init_getch(WINDOW *win, GetchFlags flags)
     16631+{
     16632+    memset(flags, FALSE, NUM_GETCH_FLAGS);
     16633+    flags[UChar('k')] = (win == stdscr);
     16634+    flags[UChar('m')] = TRUE;
     16635+
     16636+    setup_getch(win, flags);
     16637+}
     16638+
     16639+static void
     16640+wgetch_help(WINDOW *win, GetchFlags flags)
     16641 {
     16642     static const char *help[] =
     16643     {
     16644@@ -731,13 +744,10 @@
     16645     int first_y, first_x;
     16646     int c;
     16647     int incount = 0;
     16648-    bool flags[256];
     16649+    GetchFlags flags;
     16650     bool blocking = (delay < 0);
     16651 
     16652-    memset(flags, FALSE, sizeof(flags));
     16653-    flags[UChar('k')] = (win == stdscr);
     16654-
     16655-    setup_getch(win, flags);
     16656+    init_getch(win, flags);
     16657     wtimeout(win, delay);
     16658     getyx(win, first_y, first_x);
     16659 
     16660@@ -835,12 +845,18 @@
     16661                }
     16662 #endif
     16663                (void) waddstr(win, keyname(c));
     16664-           } else if (c > 0x80) {
     16665-               unsigned c2 = (unsigned) (c & 0x7f);
     16666-               if (isprint(c2))
     16667-                   (void) wprintw(win, "M-%c", UChar(c2));
     16668-               else
     16669+           } else if (c >= 0x80) {
     16670+               unsigned c2 = (unsigned) c;
     16671+#if !(defined(NCURSES_VERSION) || defined(_XOPEN_CURSES))
     16672+               /* at least Solaris SVR4 curses breaks unctrl(128), etc. */
     16673+               c2 &= 0x7f;
     16674+#endif
     16675+               if (isprint(c))
     16676+                   (void) wprintw(win, "%c", UChar(c));
     16677+               else if (c2 != UChar(c))
     16678                    (void) wprintw(win, "M-%s", unctrl(c2));
     16679+               else
     16680+                   (void) wprintw(win, "%s", unctrl(c2));
     16681                waddstr(win, " (high-half character)");
     16682            } else {
     16683                if (isprint(c))
     16684@@ -854,6 +870,9 @@
     16685     }
     16686 
     16687     wtimeout(win, -1);
     16688+
     16689+    if (!level)
     16690+       init_getch(win, flags);
     16691 }
     16692 
     16693 static int
     16694@@ -978,15 +997,12 @@
     16695     int first_y, first_x;
     16696     wint_t c;
     16697     int incount = 0;
     16698-    bool flags[256];
     16699+    GetchFlags flags;
     16700     bool blocking = (delay < 0);
     16701     int y, x, code;
     16702     char *temp;
     16703 
     16704-    memset(flags, FALSE, sizeof(flags));
     16705-    flags[UChar('k')] = (win == stdscr);
     16706-
     16707-    setup_getch(win, flags);
     16708+    init_getch(win, flags);
     16709     wtimeout(win, delay);
     16710     getyx(win, first_y, first_x);
     16711 
     16712@@ -1096,14 +1112,14 @@
     16713                    resize_wide_boxes(level, win);
     16714                }
     16715 #endif
     16716-               (void) waddstr(win, key_name((wchar_t) c));
     16717+               (void) waddstr(win, keyname((wchar_t) c));
     16718            } else {
     16719+               (void) waddstr(win, key_name((wchar_t) c));
     16720                if (c < 256 && iscntrl(c)) {
     16721-                   (void) wprintw(win, "%s (control character)", unctrl(c));
     16722+                   (void) wprintw(win, " (control character)");
     16723                } else {
     16724-                   wchar_t c2 = (wchar_t) c;
     16725-                   waddnwstr(win, &c2, 1);
     16726-                   (void) wprintw(win, " = %#x (printable character)", (unsigned) c);
     16727+                   (void) wprintw(win, " = %#x (printable character)",
     16728+                                  (unsigned) c);
     16729                }
     16730            }
     16731            wgetch_wrap(win, first_y);
     16732@@ -1111,6 +1127,9 @@
     16733     }
     16734 
     16735     wtimeout(win, -1);
     16736+
     16737+    if (!level)
     16738+       init_getch(win, flags);
     16739 }
     16740 
     16741 static void
     16742@@ -1840,6 +1859,8 @@
     16743            width = 4;
     16744        } else if (color >= 8) {
     16745            sprintf(temp, "[%02d]", color);
     16746+       } else if (color < 0) {
     16747+           strcpy(temp, "default");
     16748        } else {
     16749            strcpy(temp, the_color_names[color]);
     16750        }
     16751@@ -1874,6 +1895,8 @@
     16752     mvwprintw(helpwin, row++, col,
     16753              "  n/N     toggle text/number on/off");
     16754     mvwprintw(helpwin, row++, col,
     16755+             "  r/R     toggle reverse on/off");
     16756+    mvwprintw(helpwin, row++, col,
     16757              "  w/W     toggle width between 8/16 colors");
     16758 #if USE_WIDEC_SUPPORT
     16759     if (wide) {
     16760@@ -1906,12 +1929,19 @@
     16761     bool done = FALSE;
     16762     bool opt_acsc = FALSE;
     16763     bool opt_bold = FALSE;
     16764-    bool opt_wide = FALSE;
     16765+    bool opt_revs = FALSE;
     16766     bool opt_nums = FALSE;
     16767+    bool opt_wide = FALSE;
     16768     WINDOW *helpwin;
     16769 
     16770-    if (pairs_max > COLOR_PAIRS)
     16771-       pairs_max = COLOR_PAIRS;
     16772+    if (COLORS * COLORS == COLOR_PAIRS) {
     16773+       int limit = (COLORS - min_colors) * (COLORS - min_colors);
     16774+       if (pairs_max > limit)
     16775+           pairs_max = limit;
     16776+    } else {
     16777+       if (pairs_max > COLOR_PAIRS)
     16778+           pairs_max = COLOR_PAIRS;
     16779+    }
     16780 
     16781     while (!done) {
     16782        int shown = 0;
     16783@@ -1926,12 +1956,14 @@
     16784            hello = "Hello";
     16785            per_row = 8;
     16786        }
     16787+       per_row -= min_colors;
     16788 
     16789        row_limit = (pairs_max + per_row - 1) / per_row;
     16790 
     16791        move(0, 0);
     16792-       (void) printw("There are %d color pairs and %d colors\n",
     16793-                     pairs_max, COLORS);
     16794+       (void) printw("There are %d color pairs and %d colors%s\n",
     16795+                     pairs_max, COLORS,
     16796+                     min_colors ? " besides 'default'" : "");
     16797 
     16798        clrtobot();
     16799        (void) mvprintw(top + 1, 0,
     16800@@ -1942,7 +1974,7 @@
     16801 
     16802        /* show color names/numbers across the top */
     16803        for (i = 0; i < per_row; i++)
     16804-           show_color_name(top + 2, (i + 1) * width, i, opt_wide);
     16805+           show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
     16806 
     16807        /* show a grid of colors, with color names/ numbers on the left */
     16808        for (i = (short) (base_row * per_row); i < pairs_max; i++) {
     16809@@ -1950,9 +1982,11 @@
     16810            int col = (i % per_row + 1) * width;
     16811            short pair = i;
     16812 
     16813+#define InxToFG(i) (short) ((i % (COLORS - min_colors)) + min_colors)
     16814+#define InxToBG(i) (short) ((i / (COLORS - min_colors)) + min_colors)
     16815            if (row >= 0 && move(row, col) != ERR) {
     16816-               short fg = (short) (i % COLORS);
     16817-               short bg = (short) (i / COLORS);
     16818+               short fg = InxToFG(i);
     16819+               short bg = InxToBG(i);
     16820 
     16821                init_pair(pair, fg, bg);
     16822                attron((attr_t) COLOR_PAIR(pair));
     16823@@ -1960,6 +1994,8 @@
     16824                    attron((attr_t) A_ALTCHARSET);
     16825                if (opt_bold)
     16826                    attron((attr_t) A_BOLD);
     16827+               if (opt_revs)
     16828+                   attron((attr_t) A_REVERSE);
     16829 
     16830                if (opt_nums) {
     16831                    sprintf(numbered, "{%02X}", i);
     16832@@ -1968,8 +2004,8 @@
     16833                printw("%-*.*s", width, width, hello);
     16834                attrset(A_NORMAL);
     16835 
     16836-               if ((i % per_row) == 0 && (i % COLORS) == 0) {
     16837-                   show_color_name(row, 0, i / COLORS, opt_wide);
     16838+               if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
     16839+                   show_color_name(row, 0, InxToBG(i), opt_wide);
     16840                }
     16841                ++shown;
     16842            } else if (shown) {
     16843@@ -1996,6 +2032,12 @@
     16844        case 'N':
     16845            opt_nums = TRUE;
     16846            break;
     16847+       case 'r':
     16848+           opt_revs = FALSE;
     16849+           break;
     16850+       case 'R':
     16851+           opt_revs = TRUE;
     16852+           break;
     16853        case case_QUIT:
     16854            done = TRUE;
     16855            continue;
     16856@@ -2073,7 +2115,7 @@
     16857     int base_row = 0;
     16858     int grid_top = top + 3;
     16859     int page_size = (LINES - grid_top);
     16860-    int pairs_max = COLOR_PAIRS;
     16861+    int pairs_max = (unsigned short) (-1);
     16862     int row_limit;
     16863     int per_row;
     16864     char numbered[80];
     16865@@ -2081,12 +2123,22 @@
     16866     bool done = FALSE;
     16867     bool opt_acsc = FALSE;
     16868     bool opt_bold = FALSE;
     16869+    bool opt_revs = FALSE;
     16870     bool opt_wide = FALSE;
     16871     bool opt_nums = FALSE;
     16872     bool opt_xchr = FALSE;
     16873     wchar_t buffer[10];
     16874     WINDOW *helpwin;
     16875 
     16876+    if (COLORS * COLORS == COLOR_PAIRS) {
     16877+       int limit = (COLORS - min_colors) * (COLORS - min_colors);
     16878+       if (pairs_max > limit)
     16879+           pairs_max = limit;
     16880+    } else {
     16881+       if (pairs_max > COLOR_PAIRS)
     16882+           pairs_max = COLOR_PAIRS;
     16883+    }
     16884+
     16885     while (!done) {
     16886        int shown = 0;
     16887 
     16888@@ -2100,6 +2152,8 @@
     16889            hello = "Hello";
     16890            per_row = 8;
     16891        }
     16892+       per_row -= min_colors;
     16893+
     16894        if (opt_xchr) {
     16895            make_fullwidth_text(buffer, hello);
     16896            width *= 2;
     16897@@ -2111,8 +2165,9 @@
     16898        row_limit = (pairs_max + per_row - 1) / per_row;
     16899 
     16900        move(0, 0);
     16901-       (void) printw("There are %d color pairs and %d colors\n",
     16902-                     pairs_max, COLORS);
     16903+       (void) printw("There are %d color pairs and %d colors%s\n",
     16904+                     pairs_max, COLORS,
     16905+                     min_colors ? " besides 'default'" : "");
     16906 
     16907        clrtobot();
     16908        (void) mvprintw(top + 1, 0,
     16909@@ -2123,7 +2178,7 @@
     16910 
     16911        /* show color names/numbers across the top */
     16912        for (i = 0; i < per_row; i++)
     16913-           show_color_name(top + 2, (i + 1) * width, i, opt_wide);
     16914+           show_color_name(top + 2, (i + 1) * width, i + min_colors, opt_wide);
     16915 
     16916        /* show a grid of colors, with color names/ numbers on the left */
     16917        for (i = (base_row * per_row); i < pairs_max; i++) {
     16918@@ -2132,12 +2187,14 @@
     16919            short pair = (short) i;
     16920 
     16921            if (row >= 0 && move(row, col) != ERR) {
     16922-               init_pair(pair, (short) (i % COLORS), (short) (i / COLORS));
     16923+               init_pair(pair, InxToFG(i), InxToBG(i));
     16924                color_set(pair, NULL);
     16925                if (opt_acsc)
     16926                    attr_on((attr_t) A_ALTCHARSET, NULL);
     16927                if (opt_bold)
     16928                    attr_on((attr_t) A_BOLD, NULL);
     16929+               if (opt_revs)
     16930+                   attr_on((attr_t) A_REVERSE, NULL);
     16931 
     16932                if (opt_nums) {
     16933                    sprintf(numbered, "{%02X}", i);
     16934@@ -2150,8 +2207,8 @@
     16935                addnwstr(buffer, width);
     16936                attr_set(A_NORMAL, 0, NULL);
     16937 
     16938-               if ((i % per_row) == 0 && (i % COLORS) == 0) {
     16939-                   show_color_name(row, 0, i / COLORS, opt_wide);
     16940+               if ((i % per_row) == 0 && InxToFG(i) == min_colors) {
     16941+                   show_color_name(row, 0, InxToBG(i), opt_wide);
     16942                }
     16943                ++shown;
     16944            } else if (shown) {
     16945@@ -2178,6 +2235,12 @@
     16946        case 'N':
     16947            opt_nums = TRUE;
     16948            break;
     16949+       case 'r':
     16950+           opt_revs = FALSE;
     16951+           break;
     16952+       case 'R':
     16953+           opt_revs = TRUE;
     16954+           break;
     16955        case case_QUIT:
     16956            done = TRUE;
     16957            continue;
     16958@@ -2802,6 +2865,7 @@
     16959 } attrs_to_cycle[] = {
     16960     { A_NORMAL,                "normal" },
     16961     { A_BOLD,          "bold" },
     16962+    { A_BLINK,         "blink" },
     16963     { A_REVERSE,       "reverse" },
     16964     { A_UNDERLINE,     "underline" },
     16965 };
     16966@@ -2902,7 +2966,7 @@
     16967        do {
     16968            if (C1)
     16969                nodelay(stdscr, TRUE);
     16970-           echochar(code | attr | COLOR_PAIR(pair));
     16971+           echochar(colored_chtype(code, attr, pair));
     16972            if (C1) {
     16973                /* (yes, this _is_ crude) */
     16974                while ((reply = Getchar()) != ERR) {
     16975@@ -2951,7 +3015,7 @@
     16976                 */
     16977                break;
     16978            default:
     16979-               addch(code | A_ALTCHARSET | attr | COLOR_PAIR(pair));
     16980+               addch(colored_chtype(code, A_ALTCHARSET | attr, pair));
     16981                break;
     16982            }
     16983        } while (--count > 0);
     16984@@ -2969,15 +3033,23 @@
     16985     mvaddstr(0, 20, "Display of the ACS Line-Drawing Set");
     16986     attroff(A_BOLD);
     16987     refresh();
     16988-    box(stdscr, 0, 0);
     16989     /* *INDENT-OFF* */
     16990-    mvhline(LINES / 2, 0,        ACS_HLINE | attr, COLS);
     16991-    mvvline(0,         COLS / 2, ACS_VLINE | attr, LINES);
     16992-    mvaddch(0,         COLS / 2, ACS_TTEE | attr);
     16993-    mvaddch(LINES / 2, COLS / 2, ACS_PLUS | attr);
     16994-    mvaddch(LINES - 1, COLS / 2, ACS_BTEE | attr);
     16995-    mvaddch(LINES / 2, 0,        ACS_LTEE | attr);
     16996-    mvaddch(LINES / 2, COLS - 1, ACS_RTEE | attr);
     16997+    wborder(stdscr,
     16998+           colored_chtype(ACS_VLINE,    attr, pair),
     16999+           colored_chtype(ACS_VLINE,    attr, pair),
     17000+            colored_chtype(ACS_HLINE,    attr, pair),
     17001+           colored_chtype(ACS_HLINE,    attr, pair),
     17002+           colored_chtype(ACS_ULCORNER, attr, pair),
     17003+           colored_chtype(ACS_URCORNER, attr, pair),
     17004+            colored_chtype(ACS_LLCORNER, attr, pair),
     17005+           colored_chtype(ACS_LRCORNER, attr, pair));
     17006+    mvhline(LINES / 2, 0,        colored_chtype(ACS_HLINE, attr, pair), COLS);
     17007+    mvvline(0,         COLS / 2, colored_chtype(ACS_VLINE, attr, pair), LINES);
     17008+    mvaddch(0,         COLS / 2, colored_chtype(ACS_TTEE,  attr, pair));
     17009+    mvaddch(LINES / 2, COLS / 2, colored_chtype(ACS_PLUS,  attr, pair));
     17010+    mvaddch(LINES - 1, COLS / 2, colored_chtype(ACS_BTEE,  attr, pair));
     17011+    mvaddch(LINES / 2, 0,        colored_chtype(ACS_LTEE,  attr, pair));
     17012+    mvaddch(LINES / 2, COLS - 1, colored_chtype(ACS_RTEE,  attr, pair));
     17013     /* *INDENT-ON* */
     17014 
     17015 }
     17016@@ -3002,7 +3074,7 @@
     17017 {
     17018     int n;
     17019 
     17020-#define BOTH(name) #name, (name | attr | COLOR_PAIR(pair))
     17021+#define BOTH(name) #name, colored_chtype(name, attr, pair)
     17022 
     17023     erase();
     17024     attron(A_BOLD);
     17025@@ -3238,7 +3310,7 @@
     17026     int col = (n / height) * COLS / 2;
     17027 
     17028     mvprintw(row, col, "%*s : ", COLS / 4, name);
     17029-    while (repeat-- >= 0) {
     17030+    while (--repeat >= 0) {
     17031        add_wch(code);
     17032     }
     17033     return n + 1;
     17034@@ -3307,12 +3379,12 @@
     17035 
     17036 #undef MERGE_ATTR
     17037 
     17038-#define MERGE_ATTR(wch) merge_wide_attr(&temp, wch, attr, pair)
     17039+#define MERGE_ATTR(n,wch) merge_wide_attr(&temp[n], wch, attr, pair)
     17040 
     17041 static void
     17042 show_wbox_chars(int repeat, attr_t attr, short pair)
     17043 {
     17044-    cchar_t temp;
     17045+    cchar_t temp[8];
     17046 
     17047     (void) repeat;
     17048     erase();
     17049@@ -3321,17 +3393,23 @@
     17050     attroff(A_BOLD);
     17051     refresh();
     17052 
     17053-    attr_set(attr, pair, 0);
     17054-    box_set(stdscr, 0, 0);
     17055-    attr_set(A_NORMAL, 0, 0);
     17056+    wborder_set(stdscr,
     17057+               MERGE_ATTR(0, WACS_VLINE),
     17058+               MERGE_ATTR(1, WACS_VLINE),
     17059+               MERGE_ATTR(2, WACS_HLINE),
     17060+               MERGE_ATTR(3, WACS_HLINE),
     17061+               MERGE_ATTR(4, WACS_ULCORNER),
     17062+               MERGE_ATTR(5, WACS_URCORNER),
     17063+               MERGE_ATTR(6, WACS_LLCORNER),
     17064+               MERGE_ATTR(7, WACS_LRCORNER));
     17065     /* *INDENT-OFF* */
     17066-    mvhline_set(LINES / 2, 0,        MERGE_ATTR(WACS_HLINE), COLS);
     17067-    mvvline_set(0,         COLS / 2, MERGE_ATTR(WACS_VLINE), LINES);
     17068-    mvadd_wch(0,           COLS / 2, MERGE_ATTR(WACS_TTEE));
     17069-    mvadd_wch(LINES / 2,   COLS / 2, MERGE_ATTR(WACS_PLUS));
     17070-    mvadd_wch(LINES - 1,   COLS / 2, MERGE_ATTR(WACS_BTEE));
     17071-    mvadd_wch(LINES / 2,   0,        MERGE_ATTR(WACS_LTEE));
     17072-    mvadd_wch(LINES / 2,   COLS - 1, MERGE_ATTR(WACS_RTEE));
     17073+    mvhline_set(LINES / 2, 0,        MERGE_ATTR(0, WACS_HLINE), COLS);
     17074+    mvvline_set(0,         COLS / 2, MERGE_ATTR(0, WACS_VLINE), LINES);
     17075+    mvadd_wch(0,           COLS / 2, MERGE_ATTR(0, WACS_TTEE));
     17076+    mvadd_wch(LINES / 2,   COLS / 2, MERGE_ATTR(0, WACS_PLUS));
     17077+    mvadd_wch(LINES - 1,   COLS / 2, MERGE_ATTR(0, WACS_BTEE));
     17078+    mvadd_wch(LINES / 2,   0,        MERGE_ATTR(0, WACS_LTEE));
     17079+    mvadd_wch(LINES / 2,   COLS - 1, MERGE_ATTR(0, WACS_RTEE));
     17080     /* *INDENT-ON* */
     17081 
     17082 }
     17083@@ -5804,7 +5882,7 @@
     17084        break;
     17085     case 2:
     17086        init_pair(cpair, COLOR_RED, COLOR_GREEN);
     17087-       wbkgdset(win, ' ' | A_BLINK | COLOR_PAIR(cpair));
     17088+       wbkgdset(win, colored_chtype(' ', A_BLINK, cpair));
     17089        break;
     17090     case 3:
     17091        wbkgdset(win, ' ' | A_NORMAL);
     17092diff -Naur ncurses-5.7.orig/test/programs ncurses-5.7/test/programs
     17093--- ncurses-5.7.orig/test/programs      2008-08-16 14:47:39.000000000 -0700
     17094+++ ncurses-5.7/test/programs   2009-01-27 16:44:52.896037435 -0800
     17095@@ -1,4 +1,4 @@
     17096-# $Id: programs,v 1.14 2008/08/16 21:47:39 tom Exp $
     17097+# $Id: programs,v 1.15 2008/12/20 21:38:44 tom Exp $
     17098 ##############################################################################
     17099 # Copyright (c) 2006-2007,2008 Free Software Foundation, Inc.                #
     17100 #                                                                            #
     17101@@ -35,6 +35,7 @@
     17102 bs             $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   bs
     17103 cardfile       $(LDFLAGS_DEFAULT)      $(LOCAL_LIBS)   cardfile
     17104 chgat          $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   chgat
     17105+clip_printw    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   clip_printw
     17106 color_set      $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   color_set
     17107 demo_altkeys   $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   demo_altkeys
     17108 demo_defkey    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   demo_defkey
     17109@@ -57,6 +58,7 @@
     17110 inch_wide      $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   inch_wide
     17111 inchs          $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   inchs
     17112 ins_wide       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   ins_wide
     17113+insdelln       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   insdelln
     17114 inserts                $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   inserts
     17115 key_names      $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   key_names
     17116 keynames       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   keynames
    1532017117diff -Naur ncurses-5.7.orig/test/README ncurses-5.7/test/README
    1532117118--- ncurses-5.7.orig/test/README        2008-10-18 14:02:45.000000000 -0700
    15322 +++ ncurses-5.7/test/README     2009-01-18 23:56:30.000000000 -0800
     17119+++ ncurses-5.7/test/README     2009-01-27 16:44:52.892037156 -0800
    1532317120@@ -25,7 +25,7 @@
    1532417121 -- sale, use or other dealings in this Software without prior written        --
     
    1561417411 wscanw                         test: testcurs
    1561517412 wscrl                          test: ncurses testcurs
    15616 diff -Naur ncurses-5.7.orig/test/clip_printw.c ncurses-5.7/test/clip_printw.c
    15617 --- ncurses-5.7.orig/test/clip_printw.c 1969-12-31 16:00:00.000000000 -0800
    15618 +++ ncurses-5.7/test/clip_printw.c      2009-01-18 23:56:30.000000000 -0800
    15619 @@ -0,0 +1,360 @@
    15620 +/****************************************************************************
    15621 + * Copyright (c) 2008 Free Software Foundation, Inc.                        *
    15622 + *                                                                          *
    15623 + * Permission is hereby granted, free of charge, to any person obtaining a  *
    15624 + * copy of this software and associated documentation files (the            *
    15625 + * "Software"), to deal in the Software without restriction, including      *
    15626 + * without limitation the rights to use, copy, modify, merge, publish,      *
    15627 + * distribute, distribute with modifications, sublicense, and/or sell       *
    15628 + * copies of the Software, and to permit persons to whom the Software is    *
    15629 + * furnished to do so, subject to the following conditions:                 *
    15630 + *                                                                          *
    15631 + * The above copyright notice and this permission notice shall be included  *
    15632 + * in all copies or substantial portions of the Software.                   *
    15633 + *                                                                          *
    15634 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
    15635 + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
    15636 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
    15637 + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
    15638 + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
    15639 + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
    15640 + * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
    15641 + *                                                                          *
    15642 + * Except as contained in this notice, the name(s) of the above copyright   *
    15643 + * holders shall not be used in advertising or otherwise to promote the     *
    15644 + * sale, use or other dealings in this Software without prior written       *
    15645 + * authorization.                                                           *
    15646 + ****************************************************************************/
    15647 +/*
    15648 + * $Id: clip_printw.c,v 1.1 2008/12/20 21:03:06 tom Exp $
    15649 + *
    15650 + * demonstrate how to use printw without wrapping.
    15651 + */
    15652 +
    15653 +#include <test.priv.h>
    15654 +
    15655 +#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
    15656 +#define COLOR_DEFAULT (-1)
    15657 +
    15658 +typedef struct {
    15659 +    unsigned c;
    15660 +    unsigned v;
    15661 +    int status;
    15662 +    int pair;
    15663 +    unsigned attr;
    15664 +    int count;
    15665 +    int ch;
    15666 +    const char *c_msg;
    15667 +    const char *v_msg;
    15668 +    int y_val;
    15669 +    int x_val;
    15670 +    int y_beg, x_beg;
    15671 +    int y_max, x_max;
    15672 +} STATUS;
    15673 +
    15674 +static int
    15675 +clip_wprintw(WINDOW *win, const char *fmt,...)
    15676 +{
    15677 +    int y0, x0, y1, x1, width;
    15678 +    WINDOW *sub;
    15679 +    va_list ap;
    15680 +    int rc;
    15681 +
    15682 +    /*
    15683 +     * Allocate a single-line derived window extending from the current
    15684 +     * cursor position to the end of the current line in the given window.
    15685 +     * Disable scrolling in the derived window.
    15686 +     */
    15687 +    getyx(win, y0, x0);
    15688 +    width = getmaxx(win) - x0;
    15689 +    sub = derwin(win, 1, width, y0, x0);
    15690 +    scrollok(sub, FALSE);
    15691 +
    15692 +    /*
    15693 +     * Print the text.
    15694 +     */
    15695 +    va_start(ap, fmt);
    15696 +    rc = vw_printw(sub, fmt, ap);
    15697 +    va_end(ap);
    15698 +
    15699 +    getyx(sub, y1, x1);
    15700 +    delwin(sub);
    15701 +
    15702 +    wmove(win, y1 + y0, x1 + x0);
    15703 +
    15704 +    return rc;
    15705 +}
    15706 +
    15707 +static const char *
    15708 +color_params(unsigned state, int *pair)
    15709 +{
    15710 +    /* *INDENT-OFF* */
    15711 +    static struct {
    15712 +       int pair;
    15713 +       int fg, bg;
    15714 +       const char *msg;
    15715 +    } table[] = {
    15716 +       { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
    15717 +       { 1, COLOR_RED,     COLOR_BLACK,   "red/black" },
    15718 +       { 2, COLOR_WHITE,   COLOR_BLUE,    "white/blue" },
    15719 +    };
    15720 +    /* *INDENT-ON* */
    15721 +
    15722 +    static bool first = TRUE;
    15723 +    const char *result = 0;
    15724 +
    15725 +    if (has_colors()) {
    15726 +       if (first) {
    15727 +           unsigned n;
    15728 +
    15729 +           start_color();
    15730 +           for (n = 0; n < SIZEOF(table); ++n) {
    15731 +               init_pair(table[n].pair, table[n].fg, table[n].bg);
    15732 +           }
    15733 +       }
    15734 +       if (state < SIZEOF(table)) {
    15735 +           *pair = table[state].pair;
    15736 +           result = table[state].msg;
    15737 +       }
    15738 +    }
    15739 +    return result;
    15740 +}
    15741 +
    15742 +static const char *
    15743 +video_params(unsigned state, unsigned *attr)
    15744 +{
    15745 +    /* *INDENT-OFF* */
    15746 +    static struct {
    15747 +       unsigned attr;
    15748 +       const char *msg;
    15749 +    } table[] = {
    15750 +       { A_NORMAL,     "normal" },
    15751 +       { A_BOLD,       "bold" },
    15752 +       { A_REVERSE,    "reverse" },
    15753 +       { A_UNDERLINE,  "underline" },
    15754 +       { A_BLINK,      "blink" },
    15755 +    };
    15756 +    /* *INDENT-ON* */
    15757 +
    15758 +    const char *result = 0;
    15759 +
    15760 +    if (state < SIZEOF(table)) {
    15761 +       *attr = table[state].attr;
    15762 +       result = table[state].msg;
    15763 +    }
    15764 +    return result;
    15765 +}
    15766 +
    15767 +/* fill the window with a test-pattern */
    15768 +static void
    15769 +fill_window(WINDOW *win)
    15770 +{
    15771 +    int y, x;
    15772 +
    15773 +    getyx(win, y, x);
    15774 +    wmove(win, 0, 0);
    15775 +    while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) {
    15776 +    }
    15777 +    wmove(win, y, x);
    15778 +}
    15779 +
    15780 +static void
    15781 +show_status(WINDOW *win, STATUS * sp)
    15782 +{
    15783 +    int y, x;
    15784 +
    15785 +    getyx(win, y, x);
    15786 +    wmove(win, 0, 0);
    15787 +    wprintw(win, "Count %d", sp->count);
    15788 +    if (sp->v_msg != 0)
    15789 +       wprintw(win, " Video %s", sp->v_msg);
    15790 +    if (sp->c_msg != 0)
    15791 +       wprintw(win, " Color %s", sp->c_msg);
    15792 +    wprintw(win, " (%d)", sp->status);
    15793 +    wclrtoeol(win);
    15794 +    wmove(win, y, x);
    15795 +}
    15796 +
    15797 +static void
    15798 +do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
    15799 +{
    15800 +    WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2,
    15801 +                         sp->y_beg + 1, sp->x_beg + 1);
    15802 +
    15803 +    if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) {
    15804 +       WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1);
    15805 +
    15806 +       if (win2 != 0) {
    15807 +           box(win1, 0, 0);
    15808 +           wrefresh(win1);
    15809 +           func(win2);
    15810 +
    15811 +           delwin(win2);
    15812 +       } else {
    15813 +           beep();
    15814 +       }
    15815 +       delwin(win1);
    15816 +       touchwin(win);
    15817 +    } else {
    15818 +       beep();
    15819 +    }
    15820 +}
    15821 +
    15822 +static void
    15823 +init_status(WINDOW *win, STATUS * sp)
    15824 +{
    15825 +    memset(sp, 0, sizeof(*sp));
    15826 +    sp->c = 99;
    15827 +    sp->v = 99;
    15828 +    sp->ch = ' ';
    15829 +
    15830 +    keypad(win, TRUE);
    15831 +    fill_window(win);
    15832 +
    15833 +    getbegyx(win, sp->y_beg, sp->x_beg);
    15834 +    getmaxyx(win, sp->y_max, sp->x_max);
    15835 +}
    15836 +
    15837 +static void
    15838 +show_help(WINDOW *win)
    15839 +{
    15840 +    static const char *table[] =
    15841 +    {
    15842 +       "Basic commands:"
    15843 +       ,"Use h/j/k/l or arrow keys to move the cursor."
    15844 +       ,"Set the count parameter for clip_wprintw by entering digits 0-9."
    15845 +       ,""
    15846 +       ,"Other commands:"
    15847 +       ,"space toggles through the set of video attributes and colors."
    15848 +       ,"t     touches (forces repaint) of the current line."
    15849 +       ,".     calls clip_wprintw at the current position with the given count."
    15850 +       ,"=     resets count to zero."
    15851 +       ,"?     shows this help-window"
    15852 +       ,""
    15853 +    };
    15854 +
    15855 +    int y_max, x_max;
    15856 +    int row;
    15857 +
    15858 +    getmaxyx(win, y_max, x_max);
    15859 +    for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
    15860 +       mvwprintw(win, row, 0, "%.*s", x_max, table[row]);
    15861 +    }
    15862 +    while (wgetch(win) != 'q')
    15863 +       beep();
    15864 +}
    15865 +
    15866 +static void
    15867 +update_status(WINDOW *win, STATUS * sp)
    15868 +{
    15869 +    switch (sp->ch) {
    15870 +    case ' ':                  /* next test-iteration */
    15871 +       if (has_colors()) {
    15872 +           if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) {
    15873 +               sp->c_msg = color_params(sp->c = 0, &(sp->pair));
    15874 +               if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
    15875 +                   sp->v_msg = video_params(sp->v = 0, &(sp->attr));
    15876 +               }
    15877 +           }
    15878 +       } else {
    15879 +           if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
    15880 +               sp->v_msg = video_params(sp->v = 0, &(sp->attr));
    15881 +           }
    15882 +       }
    15883 +       sp->count = 0;
    15884 +       show_status(win, sp);
    15885 +       break;
    15886 +    case KEY_LEFT:
    15887 +    case 'h':
    15888 +       if (sp->x_val > 0)
    15889 +           wmove(win, sp->y_val, --(sp->x_val));
    15890 +       break;
    15891 +    case KEY_DOWN:
    15892 +    case 'j':
    15893 +       if (sp->y_val < sp->y_max)
    15894 +           wmove(win, ++(sp->y_val), sp->x_val);
    15895 +       break;
    15896 +    case KEY_UP:
    15897 +    case 'k':
    15898 +       if (sp->y_val > 0)
    15899 +           wmove(win, --(sp->y_val), sp->x_val);
    15900 +       break;
    15901 +    case KEY_RIGHT:
    15902 +    case 'l':
    15903 +       if (sp->x_val < sp->x_max)
    15904 +           wmove(win, sp->y_val, ++(sp->x_val));
    15905 +       break;
    15906 +    case 't':
    15907 +       touchline(win, sp->y_val, 1);
    15908 +       break;
    15909 +    case '=':
    15910 +       sp->count = 0;
    15911 +       show_status(win, sp);
    15912 +       break;
    15913 +    case '?':
    15914 +       do_subwindow(win, sp, show_help);
    15915 +       break;
    15916 +    default:
    15917 +       if (isdigit(sp->ch)) {
    15918 +           sp->count = (sp->count * 10) + (sp->ch - '0');
    15919 +           show_status(win, sp);
    15920 +       } else {
    15921 +           beep();
    15922 +       }
    15923 +       break;
    15924 +    }
    15925 +}
    15926 +
    15927 +static void
    15928 +test_clipping(WINDOW *win)
    15929 +{
    15930 +    STATUS st;
    15931 +    char fmt[80];
    15932 +    char *buffer;
    15933 +    unsigned j, need;
    15934 +
    15935 +    init_status(win, &st);
    15936 +
    15937 +    do {
    15938 +       switch (st.ch) {
    15939 +       case '.':               /* change from current position */
    15940 +           wattrset(win, st.attr | COLOR_PAIR(st.pair));
    15941 +           if (st.count > 0) {
    15942 +               need = st.count + 1;
    15943 +               sprintf(fmt, "%%c%%%ds%%c", st.count);
    15944 +           } else {
    15945 +               need = getmaxx(win) - 1;
    15946 +               strcpy(fmt, "%c%s%c");
    15947 +           }
    15948 +           if ((buffer = typeMalloc(char, need)) != 0) {
    15949 +               for (j = 0; j < need; ++j) {
    15950 +                   buffer[j] = 'A' + (j % 26);
    15951 +               }
    15952 +               buffer[need - 1] = '\0';
    15953 +               st.status = clip_wprintw(win, fmt, '[', buffer, ']');
    15954 +           }
    15955 +           break;
    15956 +       case 'w':
    15957 +           do_subwindow(win, &st, test_clipping);
    15958 +           break;
    15959 +       case 'q':
    15960 +           return;
    15961 +       default:
    15962 +           update_status(win, &st);
    15963 +           break;
    15964 +       }
    15965 +    } while ((st.ch = wgetch(win)) != ERR);
    15966 +}
    15967 +
    15968 +int
    15969 +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
    15970 +{
    15971 +    initscr();
    15972 +    cbreak();
    15973 +    noecho();
    15974 +
    15975 +    test_clipping(stdscr);
    15976 +    endwin();
    15977 +
    15978 +    ExitProgram(EXIT_SUCCESS);
    15979 +}
    15980 diff -Naur ncurses-5.7.orig/test/demo_forms.c ncurses-5.7/test/demo_forms.c
    15981 --- ncurses-5.7.orig/test/demo_forms.c  2008-10-18 13:38:20.000000000 -0700
    15982 +++ ncurses-5.7/test/demo_forms.c       2009-01-18 23:56:30.000000000 -0800
    15983 @@ -26,7 +26,7 @@
    15984   * authorization.                                                           *
    15985   ****************************************************************************/
    15986  /*
    15987 - * $Id: demo_forms.c,v 1.30 2008/10/18 20:38:20 tom Exp $
    15988 + * $Id: demo_forms.c,v 1.31 2008/12/20 19:23:00 tom Exp $
    15989   *
    15990   * Demonstrate a variety of functions from the form library.
    15991   * Thomas Dickey - 2003/4/26
    15992 @@ -97,6 +97,8 @@
    15993      FIELD *f = new_field(rows, cols, frow, fcol, o_value, 1);
    15994  
    15995      if (f) {
    15996 +       FieldAttrs *ptr;
    15997 +
    15998         set_field_back(f, A_UNDERLINE);
    15999         /*
    16000          * If -j and -d options are combined, -j loses.  It is documented in
    16001 @@ -122,7 +124,12 @@
    16002         /*
    16003          * The userptr is used in edit_field.c's inactive_field().
    16004          */
    16005 -       set_field_userptr(f, (void *) (long) field_back(f));
    16006 +       ptr = (FieldAttrs *) field_userptr(f);
    16007 +       if (ptr == 0) {
    16008 +           ptr = typeCalloc(FieldAttrs, 1);
    16009 +           ptr->background = field_back(f);
    16010 +       }
    16011 +       set_field_userptr(f, (void *) ptr);
    16012         if (t_value)
    16013             set_field_buffer(f, 0, t_value);
    16014      }
    16015 diff -Naur ncurses-5.7.orig/test/edit_field.c ncurses-5.7/test/edit_field.c
    16016 --- ncurses-5.7.orig/test/edit_field.c  2008-10-18 13:40:20.000000000 -0700
    16017 +++ ncurses-5.7/test/edit_field.c       2009-01-18 23:56:30.000000000 -0800
    16018 @@ -26,7 +26,7 @@
    16019   * authorization.                                                           *
    16020   ****************************************************************************/
    16021  /*
    16022 - * $Id: edit_field.c,v 1.14 2008/10/18 20:40:20 tom Exp $
    16023 + * $Id: edit_field.c,v 1.15 2008/12/20 19:23:01 tom Exp $
    16024   *
    16025   * A wrapper for form_driver() which keeps track of the user's editing changes
    16026   * for each field, and makes the result available as a null-terminated string
    16027 @@ -294,8 +294,8 @@
    16028  static void
    16029  inactive_field(FIELD * f)
    16030  {
    16031 -    void *ptr = field_userptr(f);
    16032 -    set_field_back(f, (chtype) ptr);
    16033 +    FieldAttrs *ptr = (FieldAttrs *) field_userptr(f);
    16034 +    set_field_back(f, ptr->background);
    16035  }
    16036  
    16037  int
    16038 diff -Naur ncurses-5.7.orig/test/edit_field.h ncurses-5.7/test/edit_field.h
    16039 --- ncurses-5.7.orig/test/edit_field.h  2006-06-03 09:38:57.000000000 -0700
    16040 +++ ncurses-5.7/test/edit_field.h       2009-01-18 23:56:30.000000000 -0800
    16041 @@ -1,5 +1,5 @@
    16042  /****************************************************************************
    16043 - * Copyright (c) 2003-2004,2005 Free Software Foundation, Inc.              *
    16044 + * Copyright (c) 2003-2006,2008 Free Software Foundation, Inc.              *
    16045   *                                                                          *
    16046   * Permission is hereby granted, free of charge, to any person obtaining a  *
    16047   * copy of this software and associated documentation files (the            *
    16048 @@ -26,7 +26,7 @@
    16049   * authorization.                                                           *
    16050   ****************************************************************************/
    16051  /*
    16052 - * $Id: edit_field.h,v 1.5 2006/06/03 16:38:57 tom Exp $
    16053 + * $Id: edit_field.h,v 1.6 2008/12/20 19:23:18 tom Exp $
    16054   *
    16055   * Interface of edit_field.c
    16056   */
    16057 @@ -43,6 +43,10 @@
    16058  #define MY_EDT_MODE    EDIT_FIELD('e')
    16059  #define MY_INS_MODE    EDIT_FIELD('t')
    16060  
    16061 +typedef struct {
    16062 +    chtype background;
    16063 +} FieldAttrs;
    16064 +
    16065  extern void help_edit_field(void);
    16066  extern int edit_field(FORM * form, int *result);
    16067  
    16068 diff -Naur ncurses-5.7.orig/test/filter.c ncurses-5.7/test/filter.c
    16069 --- ncurses-5.7.orig/test/filter.c      2006-12-09 08:53:47.000000000 -0800
    16070 +++ ncurses-5.7/test/filter.c   2009-01-18 23:56:25.000000000 -0800
    16071 @@ -1,5 +1,5 @@
    16072  /****************************************************************************
    16073 - * Copyright (c) 1998-2005,2006 Free Software Foundation, Inc.              *
    16074 + * Copyright (c) 1998-2006,2008 Free Software Foundation, Inc.              *
    16075   *                                                                          *
    16076   * Permission is hereby granted, free of charge, to any person obtaining a  *
    16077   * copy of this software and associated documentation files (the            *
    16078 @@ -29,7 +29,7 @@
    16079  /*
    16080   * Author:  Thomas E. Dickey <dickey@clark.net> 1998
    16081   *
    16082 - * $Id: filter.c,v 1.11 2006/12/09 16:53:47 tom Exp $
    16083 + * $Id: filter.c,v 1.12 2008/12/06 21:59:27 tom Exp $
    16084   */
    16085  #include <test.priv.h>
    16086  
    16087 @@ -78,16 +78,50 @@
    16088      return code;
    16089  }
    16090  
    16091 +static void
    16092 +usage(void)
    16093 +{
    16094 +    static const char *msg[] =
    16095 +    {
    16096 +       "Usage: filter [options]"
    16097 +       ,""
    16098 +       ,"Options:"
    16099 +       ,"  -i   use initscr() rather than newterm()"
    16100 +    };
    16101 +    unsigned n;
    16102 +    for (n = 0; n < SIZEOF(msg); n++)
    16103 +       fprintf(stderr, "%s\n", msg[n]);
    16104 +    ExitProgram(EXIT_FAILURE);
    16105 +}
    16106 +
    16107  int
    16108 -main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
    16109 +main(int argc, char *argv[])
    16110  {
    16111 +    int ch;
    16112      char buffer[80];
    16113      attr_t underline;
    16114 +    bool i_option = FALSE;
    16115  
    16116      setlocale(LC_ALL, "");
    16117  
    16118 +    while ((ch = getopt(argc, argv, "i")) != -1) {
    16119 +       switch (ch) {
    16120 +       case 'i':
    16121 +           i_option = TRUE;
    16122 +           break;
    16123 +       default:
    16124 +           usage();
    16125 +       }
    16126 +    }
    16127 +
    16128 +    printf("starting filter program using %s...\n",
    16129 +          i_option ? "initscr" : "newterm");
    16130      filter();
    16131 -    (void) newterm((char *) 0, stdout, stdin);
    16132 +    if (i_option) {
    16133 +       initscr();
    16134 +    } else {
    16135 +       (void) newterm((char *) 0, stdout, stdin);
    16136 +    }
    16137      cbreak();
    16138      keypad(stdscr, TRUE);
    16139  
    16140 diff -Naur ncurses-5.7.orig/test/insdelln.c ncurses-5.7/test/insdelln.c
    16141 --- ncurses-5.7.orig/test/insdelln.c    1969-12-31 16:00:00.000000000 -0800
    16142 +++ ncurses-5.7/test/insdelln.c 2009-01-18 23:56:30.000000000 -0800
    16143 @@ -0,0 +1,380 @@
    16144 +/****************************************************************************
    16145 + * Copyright (c) 2008 Free Software Foundation, Inc.                        *
    16146 + *                                                                          *
    16147 + * Permission is hereby granted, free of charge, to any person obtaining a  *
    16148 + * copy of this software and associated documentation files (the            *
    16149 + * "Software"), to deal in the Software without restriction, including      *
    16150 + * without limitation the rights to use, copy, modify, merge, publish,      *
    16151 + * distribute, distribute with modifications, sublicense, and/or sell       *
    16152 + * copies of the Software, and to permit persons to whom the Software is    *
    16153 + * furnished to do so, subject to the following conditions:                 *
    16154 + *                                                                          *
    16155 + * The above copyright notice and this permission notice shall be included  *
    16156 + * in all copies or substantial portions of the Software.                   *
    16157 + *                                                                          *
    16158 + * THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS  *
    16159 + * OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF               *
    16160 + * MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.   *
    16161 + * IN NO EVENT SHALL THE ABOVE COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM,   *
    16162 + * DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR    *
    16163 + * OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR    *
    16164 + * THE USE OR OTHER DEALINGS IN THE SOFTWARE.                               *
    16165 + *                                                                          *
    16166 + * Except as contained in this notice, the name(s) of the above copyright   *
    16167 + * holders shall not be used in advertising or otherwise to promote the     *
    16168 + * sale, use or other dealings in this Software without prior written       *
    16169 + * authorization.                                                           *
    16170 + ****************************************************************************/
    16171 +/*
    16172 + * $Id: insdelln.c,v 1.1 2008/12/20 22:06:52 tom Exp $
    16173 + *
    16174 + * test-driver for deleteln, wdeleteln, insdelln, winsdelln, insertln, winsertln
    16175 + */
    16176 +
    16177 +#include <test.priv.h>
    16178 +
    16179 +#define SHOW(n) ((n) == ERR ? "ERR" : "OK")
    16180 +#define COLOR_DEFAULT (-1)
    16181 +
    16182 +typedef struct {
    16183 +    unsigned c;
    16184 +    unsigned v;
    16185 +    int pair;
    16186 +    unsigned attr;
    16187 +    int count;
    16188 +    int ch;
    16189 +    const char *c_msg;
    16190 +    const char *v_msg;
    16191 +    int y_val;
    16192 +    int x_val;
    16193 +    int y_beg, x_beg;
    16194 +    int y_max, x_max;
    16195 +} STATUS;
    16196 +
    16197 +static const char *
    16198 +color_params(unsigned state, int *pair)
    16199 +{
    16200 +    /* *INDENT-OFF* */
    16201 +    static struct {
    16202 +       int pair;
    16203 +       int fg, bg;
    16204 +       const char *msg;
    16205 +    } table[] = {
    16206 +       { 0, COLOR_DEFAULT, COLOR_DEFAULT, "default" },
    16207 +       { 1, COLOR_RED,     COLOR_BLACK,   "red/black" },
    16208 +       { 2, COLOR_WHITE,   COLOR_BLUE,    "white/blue" },
    16209 +    };
    16210 +    /* *INDENT-ON* */
    16211 +
    16212 +    static bool first = TRUE;
    16213 +    const char *result = 0;
    16214 +
    16215 +    if (has_colors()) {
    16216 +       if (first) {
    16217 +           unsigned n;
    16218 +
    16219 +           start_color();
    16220 +           for (n = 0; n < SIZEOF(table); ++n) {
    16221 +               init_pair(table[n].pair, table[n].fg, table[n].bg);
    16222 +           }
    16223 +       }
    16224 +       if (state < SIZEOF(table)) {
    16225 +           *pair = table[state].pair;
    16226 +           result = table[state].msg;
    16227 +       }
    16228 +    }
    16229 +    return result;
    16230 +}
    16231 +
    16232 +static const char *
    16233 +video_params(unsigned state, unsigned *attr)
    16234 +{
    16235 +    /* *INDENT-OFF* */
    16236 +    static struct {
    16237 +       unsigned attr;
    16238 +       const char *msg;
    16239 +    } table[] = {
    16240 +       { A_NORMAL,     "normal" },
    16241 +       { A_BOLD,       "bold" },
    16242 +       { A_REVERSE,    "reverse" },
    16243 +       { A_UNDERLINE,  "underline" },
    16244 +       { A_BLINK,      "blink" },
    16245 +    };
    16246 +    /* *INDENT-ON* */
    16247 +
    16248 +    const char *result = 0;
    16249 +
    16250 +    if (state < SIZEOF(table)) {
    16251 +       *attr = table[state].attr;
    16252 +       result = table[state].msg;
    16253 +    }
    16254 +    return result;
    16255 +}
    16256 +
    16257 +/* fill the window with a test-pattern */
    16258 +static void
    16259 +fill_window(WINDOW *win)
    16260 +{
    16261 +    int y, x;
    16262 +
    16263 +    getyx(win, y, x);
    16264 +    wmove(win, 1, 0);
    16265 +    while (waddstr(win, "0123456789 abcdefghijklmnopqrstuvwxyz ") != ERR) {
    16266 +    }
    16267 +    wmove(win, y, x);
    16268 +}
    16269 +
    16270 +static void
    16271 +show_status(WINDOW *win, STATUS * sp)
    16272 +{
    16273 +    int y, x;
    16274 +
    16275 +    getyx(win, y, x);
    16276 +    wmove(win, 0, 0);
    16277 +    wprintw(win, "Count %d", sp->count);
    16278 +    if (sp->v_msg != 0)
    16279 +       wprintw(win, " Video %s", sp->v_msg);
    16280 +    if (sp->c_msg != 0)
    16281 +       wprintw(win, " Color %s", sp->c_msg);
    16282 +    wclrtoeol(win);
    16283 +    wmove(win, y, x);
    16284 +}
    16285 +
    16286 +static void
    16287 +reshow_status(WINDOW *win, STATUS * sp)
    16288 +{
    16289 +    fill_window(win);
    16290 +    show_status(win, sp);
    16291 +}
    16292 +
    16293 +static void
    16294 +do_subwindow(WINDOW *win, STATUS * sp, void func(WINDOW *))
    16295 +{
    16296 +    WINDOW *win1 = newwin(sp->y_max - 2, sp->x_max - 2,
    16297 +                         sp->y_beg + 1, sp->x_beg + 1);
    16298 +
    16299 +    if (win1 != 0 && sp->y_max > 4 && sp->x_max > 4) {
    16300 +       WINDOW *win2 = derwin(win1, sp->y_max - 4, sp->x_max - 4, 1, 1);
    16301 +
    16302 +       if (win2 != 0) {
    16303 +           box(win1, 0, 0);
    16304 +           wrefresh(win1);
    16305 +           func(win2);
    16306 +
    16307 +           delwin(win2);
    16308 +       } else {
    16309 +           beep();
    16310 +       }
    16311 +       delwin(win1);
    16312 +       touchwin(win);
    16313 +    } else {
    16314 +       beep();
    16315 +    }
    16316 +}
    16317 +
    16318 +static void
    16319 +init_status(WINDOW *win, STATUS * sp)
    16320 +{
    16321 +    memset(sp, 0, sizeof(*sp));
    16322 +    sp->c = 99;
    16323 +    sp->v = 99;
    16324 +    sp->ch = ' ';
    16325 +
    16326 +    keypad(win, TRUE);
    16327 +    fill_window(win);
    16328 +
    16329 +    getbegyx(win, sp->y_beg, sp->x_beg);
    16330 +    getmaxyx(win, sp->y_max, sp->x_max);
    16331 +}
    16332 +
    16333 +static void
    16334 +show_help(WINDOW *win)
    16335 +{
    16336 +    static const char *table[] =
    16337 +    {
    16338 +       "Basic commands:"
    16339 +       ,"Use h/j/k/l or arrow keys to move the cursor."
    16340 +       ,"Set the count parameter for insert/delete by entering digits 0-9."
    16341 +       ,""
    16342 +       ,"Other commands:"
    16343 +       ,"space toggles through the set of video attributes and colors."
    16344 +       ,"t     touches (forces repaint) of the current line."
    16345 +       ,"i     calls insertln at the current position with the given count."
    16346 +       ,"d     calls deleteln at the window beginning with the given count."
    16347 +       ,"I     calls insdelln at the window beginning with the given count."
    16348 +       ,"D     calls insdelln at the window beginning with the given -count."
    16349 +       ,"f     refills the window with test-pattern using current attributes."
    16350 +       ,"w     recur to test windows other than stdscr"
    16351 +       ,"q     quit"
    16352 +       ,"=     resets count to zero."
    16353 +       ,"?     shows this help-window"
    16354 +       ,""
    16355 +       ,""
    16356 +    };
    16357 +
    16358 +    int y_max, x_max;
    16359 +    int row;
    16360 +
    16361 +    getmaxyx(win, y_max, x_max);
    16362 +    for (row = 0; row < (int) SIZEOF(table) && row < y_max; ++row) {
    16363 +       mvwprintw(win, row, 0, "%.*s", x_max, table[row]);
    16364 +    }
    16365 +    while (wgetch(win) != 'q')
    16366 +       beep();
    16367 +}
    16368 +
    16369 +static void
    16370 +update_status(WINDOW *win, STATUS * sp)
    16371 +{
    16372 +    switch (sp->ch) {
    16373 +    case ' ':                  /* next test-iteration */
    16374 +       if (has_colors()) {
    16375 +           if ((sp->c_msg = color_params(++(sp->c), &(sp->pair))) == 0) {
    16376 +               sp->c_msg = color_params(sp->c = 0, &(sp->pair));
    16377 +               if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
    16378 +                   sp->v_msg = video_params(sp->v = 0, &(sp->attr));
    16379 +               }
    16380 +           }
    16381 +       } else {
    16382 +           if ((sp->v_msg = video_params(++(sp->v), &(sp->attr))) == 0) {
    16383 +               sp->v_msg = video_params(sp->v = 0, &(sp->attr));
    16384 +           }
    16385 +       }
    16386 +       sp->count = 0;
    16387 +       show_status(win, sp);
    16388 +       break;
    16389 +    case KEY_LEFT:
    16390 +    case 'h':
    16391 +       if (sp->x_val > 0)
    16392 +           wmove(win, sp->y_val, --(sp->x_val));
    16393 +       break;
    16394 +    case KEY_DOWN:
    16395 +    case 'j':
    16396 +       if (sp->y_val < sp->y_max)
    16397 +           wmove(win, ++(sp->y_val), sp->x_val);
    16398 +       break;
    16399 +    case KEY_UP:
    16400 +    case 'k':
    16401 +       if (sp->y_val > 0)
    16402 +           wmove(win, --(sp->y_val), sp->x_val);
    16403 +       break;
    16404 +    case KEY_RIGHT:
    16405 +    case 'l':
    16406 +       if (sp->x_val < sp->x_max)
    16407 +           wmove(win, sp->y_val, ++(sp->x_val));
    16408 +       break;
    16409 +    case 't':
    16410 +       touchline(win, sp->y_val, 1);
    16411 +       break;
    16412 +    case '=':
    16413 +       sp->count = 0;
    16414 +       show_status(win, sp);
    16415 +       break;
    16416 +    case '?':
    16417 +       do_subwindow(win, sp, show_help);
    16418 +       break;
    16419 +    default:
    16420 +       if (isdigit(sp->ch)) {
    16421 +           sp->count = (sp->count * 10) + (sp->ch - '0');
    16422 +           show_status(win, sp);
    16423 +       } else {
    16424 +           beep();
    16425 +       }
    16426 +       break;
    16427 +    }
    16428 +}
    16429 +
    16430 +static void
    16431 +test_winsdelln(WINDOW *win)
    16432 +{
    16433 +    STATUS st;
    16434 +    int n;
    16435 +
    16436 +    init_status(win, &st);
    16437 +
    16438 +    do {
    16439 +       wattrset(win, st.attr | COLOR_PAIR(st.pair));
    16440 +       switch (st.ch) {
    16441 +       case 'i':
    16442 +           for (n = 0; n < st.count; ++n)
    16443 +               winsertln(win);
    16444 +           break;
    16445 +       case 'd':
    16446 +           for (n = 0; n < st.count; ++n)
    16447 +               wdeleteln(win);
    16448 +           break;
    16449 +       case 'I':
    16450 +           winsdelln(win, st.count);
    16451 +           break;
    16452 +       case 'D':
    16453 +           winsdelln(win, -st.count);
    16454 +           break;
    16455 +       case 'f':
    16456 +           fill_window(win);
    16457 +           reshow_status(win, &st);
    16458 +           break;
    16459 +       case 'w':
    16460 +           do_subwindow(win, &st, test_winsdelln);
    16461 +           break;
    16462 +       case 'q':
    16463 +           return;
    16464 +       default:
    16465 +           update_status(win, &st);
    16466 +           break;
    16467 +       }
    16468 +    } while ((st.ch = wgetch(win)) != ERR);
    16469 +}
    16470 +
    16471 +static void
    16472 +test_insdelln(void)
    16473 +{
    16474 +    STATUS st;
    16475 +    int n;
    16476 +
    16477 +    init_status(stdscr, &st);
    16478 +
    16479 +    do {
    16480 +       attrset(st.attr | COLOR_PAIR(st.pair));
    16481 +       switch (st.ch) {
    16482 +       case 'i':
    16483 +           for (n = 0; n < st.count; ++n)
    16484 +               insertln();
    16485 +           break;
    16486 +       case 'd':
    16487 +           for (n = 0; n < st.count; ++n)
    16488 +               deleteln();
    16489 +           break;
    16490 +       case 'I':
    16491 +           insdelln(st.count);
    16492 +           break;
    16493 +       case 'D':
    16494 +           insdelln(-st.count);
    16495 +           break;
    16496 +       case 'f':
    16497 +           fill_window(stdscr);
    16498 +           reshow_status(stdscr, &st);
    16499 +           break;
    16500 +       case 'w':
    16501 +           do_subwindow(stdscr, &st, test_winsdelln);
    16502 +           break;
    16503 +       case 'q':
    16504 +           return;
    16505 +       default:
    16506 +           update_status(stdscr, &st);
    16507 +           break;
    16508 +       }
    16509 +    } while ((st.ch = getch()) != ERR);
    16510 +}
    16511 +
    16512 +int
    16513 +main(int argc GCC_UNUSED, char *argv[]GCC_UNUSED)
    16514 +{
    16515 +    initscr();
    16516 +    cbreak();
    16517 +    noecho();
    16518 +
    16519 +    test_insdelln();
    16520 +    endwin();
    16521 +
    16522 +    ExitProgram(EXIT_SUCCESS);
    16523 +}
    16524 diff -Naur ncurses-5.7.orig/test/modules ncurses-5.7/test/modules
    16525 --- ncurses-5.7.orig/test/modules       2007-08-18 10:57:08.000000000 -0700
    16526 +++ ncurses-5.7/test/modules    2009-01-18 23:56:30.000000000 -0800
    16527 @@ -1,4 +1,4 @@
    16528 -# $Id: modules,v 1.36 2007/08/18 17:57:08 tom Exp $
    16529 +# $Id: modules,v 1.37 2008/12/20 21:38:44 tom Exp $
    16530  ##############################################################################
    16531  # Copyright (c) 1998-2006,2007 Free Software Foundation, Inc.                #
    16532  #                                                                            #
    16533 @@ -37,6 +37,7 @@
    16534  bs             progs           $(srcdir)       $(HEADER_DEPS)
    16535  cardfile       progs           $(srcdir)       $(HEADER_DEPS)  ../include/panel.h ../include/form.h
    16536  chgat          progs           $(srcdir)       $(HEADER_DEPS)
    16537 +clip_printw    progs           $(srcdir)       $(HEADER_DEPS)
    16538  color_set      progs           $(srcdir)       $(HEADER_DEPS)
    16539  demo_altkeys   progs           $(srcdir)       $(HEADER_DEPS)
    16540  demo_defkey    progs           $(srcdir)       $(HEADER_DEPS)
    16541 @@ -60,6 +61,7 @@
    16542  inch_wide      progs           $(srcdir)       $(HEADER_DEPS)
    16543  inchs          progs           $(srcdir)       $(HEADER_DEPS)
    16544  ins_wide       progs           $(srcdir)       $(HEADER_DEPS)
    16545 +insdelln       progs           $(srcdir)       $(HEADER_DEPS)
    16546  inserts                progs           $(srcdir)       $(HEADER_DEPS)
    16547  key_names      progs           $(srcdir)       $(HEADER_DEPS)
    16548  keynames       progs           $(srcdir)       $(HEADER_DEPS)
    16549 diff -Naur ncurses-5.7.orig/test/ncurses.c ncurses-5.7/test/ncurses.c
    16550 --- ncurses-5.7.orig/test/ncurses.c     2008-09-27 07:34:58.000000000 -0700
    16551 +++ ncurses-5.7/test/ncurses.c  2009-01-18 23:56:30.000000000 -0800
    16552 @@ -40,7 +40,7 @@
    16553     Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
    16554             Thomas E. Dickey (beginning revision 1.27 in 1996).
    16555  
    16556 -$Id: ncurses.c,v 1.329 2008/09/27 14:34:58 tom Exp $
    16557 +$Id: ncurses.c,v 1.334 2008/12/20 17:13:27 tom Exp $
    16558  
    16559  ***************************************************************************/
    16560  
    16561 @@ -569,8 +569,11 @@
    16562   *
    16563   ****************************************************************************/
    16564  
    16565 +#define NUM_GETCH_FLAGS 256
    16566 +typedef bool GetchFlags[NUM_GETCH_FLAGS];
    16567 +
    16568  static void
    16569 -setup_getch(WINDOW *win, bool flags[])
    16570 +setup_getch(WINDOW *win, GetchFlags flags)
    16571  {
    16572      keypad(win, flags['k']);   /* should be redundant, but for testing */
    16573      meta(win, flags['m']);     /* force this to a known state */
    16574 @@ -581,7 +584,17 @@
    16575  }
    16576  
    16577  static void
    16578 -wgetch_help(WINDOW *win, bool flags[])
    16579 +init_getch(WINDOW *win, GetchFlags flags)
    16580 +{
    16581 +    memset(flags, FALSE, NUM_GETCH_FLAGS);
    16582 +    flags[UChar('k')] = (win == stdscr);
    16583 +    flags[UChar('m')] = TRUE;
    16584 +
    16585 +    setup_getch(win, flags);
    16586 +}
    16587 +
    16588 +static void
    16589 +wgetch_help(WINDOW *win, GetchFlags flags)
    16590  {
    16591      static const char *help[] =
    16592      {
    16593 @@ -731,13 +744,10 @@
    16594      int first_y, first_x;
    16595      int c;
    16596      int incount = 0;
    16597 -    bool flags[256];
    16598 +    GetchFlags flags;
    16599      bool blocking = (delay < 0);
    16600  
    16601 -    memset(flags, FALSE, sizeof(flags));
    16602 -    flags[UChar('k')] = (win == stdscr);
    16603 -
    16604 -    setup_getch(win, flags);
    16605 +    init_getch(win, flags);
    16606      wtimeout(win, delay);
    16607      getyx(win, first_y, first_x);
    16608  
    16609 @@ -835,12 +845,18 @@
    16610                 }
    16611  #endif
    16612                 (void) waddstr(win, keyname(c));
    16613 -           } else if (c > 0x80) {
    16614 -               unsigned c2 = (unsigned) (c & 0x7f);
    16615 -               if (isprint(c2))
    16616 -                   (void) wprintw(win, "M-%c", UChar(c2));
    16617 -               else
    16618 +           } else if (c >= 0x80) {
    16619 +               unsigned c2 = (unsigned) c;
    16620 +#if !(defined(NCURSES_VERSION) || defined(_XOPEN_CURSES))
    16621 +               /* at least Solaris SVR4 curses breaks unctrl(128), etc. */
    16622 +               c2 &= 0x7f;
    16623 +#endif
    16624 +               if (isprint(c))
    16625 +                   (void) wprintw(win, "%c", UChar(c));
    16626 +               else if (c2 != UChar(c))
    16627                     (void) wprintw(win, "M-%s", unctrl(c2));
    16628 +               else
    16629 +                   (void) wprintw(win, "%s", unctrl(c2));
    16630                 waddstr(win, " (high-half character)");
    16631             } else {
    16632                 if (isprint(c))
    16633 @@ -854,6 +870,9 @@
    16634      }
    16635  
    16636      wtimeout(win, -1);
    16637 +
    16638 +    if (!level)
    16639 +       init_getch(win, flags);
    16640  }
    16641  
    16642  static int
    16643 @@ -978,15 +997,12 @@
    16644      int first_y, first_x;
    16645      wint_t c;
    16646      int incount = 0;
    16647 -    bool flags[256];
    16648 +    GetchFlags flags;
    16649      bool blocking = (delay < 0);
    16650      int y, x, code;
    16651      char *temp;
    16652  
    16653 -    memset(flags, FALSE, sizeof(flags));
    16654 -    flags[UChar('k')] = (win == stdscr);
    16655 -
    16656 -    setup_getch(win, flags);
    16657 +    init_getch(win, flags);
    16658      wtimeout(win, delay);
    16659      getyx(win, first_y, first_x);
    16660  
    16661 @@ -1096,14 +1112,14 @@
    16662                     resize_wide_boxes(level, win);
    16663                 }
    16664  #endif
    16665 -               (void) waddstr(win, key_name((wchar_t) c));
    16666 +               (void) waddstr(win, keyname((wchar_t) c));
    16667             } else {
    16668 +               (void) waddstr(win, key_name((wchar_t) c));
    16669                 if (c < 256 && iscntrl(c)) {
    16670 -                   (void) wprintw(win, "%s (control character)", unctrl(c));
    16671 +                   (void) wprintw(win, " (control character)");
    16672                 } else {
    16673 -                   wchar_t c2 = (wchar_t) c;
    16674 -                   waddnwstr(win, &c2, 1);
    16675 -                   (void) wprintw(win, " = %#x (printable character)", (unsigned) c);
    16676 +                   (void) wprintw(win, " = %#x (printable character)",
    16677 +                                  (unsigned) c);
    16678                 }
    16679             }
    16680             wgetch_wrap(win, first_y);
    16681 @@ -1111,6 +1127,9 @@
    16682      }
    16683  
    16684      wtimeout(win, -1);
    16685 +
    16686 +    if (!level)
    16687 +       init_getch(win, flags);
    16688  }
    16689  
    16690  static void
    16691 @@ -2802,6 +2821,7 @@
    16692  } attrs_to_cycle[] = {
    16693      { A_NORMAL,                "normal" },
    16694      { A_BOLD,          "bold" },
    16695 +    { A_BLINK,         "blink" },
    16696      { A_REVERSE,       "reverse" },
    16697      { A_UNDERLINE,     "underline" },
    16698  };
    16699 @@ -2902,7 +2922,7 @@
    16700         do {
    16701             if (C1)
    16702                 nodelay(stdscr, TRUE);
    16703 -           echochar(code | attr | COLOR_PAIR(pair));
    16704 +           echochar(colored_chtype(code, attr, pair));
    16705             if (C1) {
    16706                 /* (yes, this _is_ crude) */
    16707                 while ((reply = Getchar()) != ERR) {
    16708 @@ -2951,7 +2971,7 @@
    16709                  */
    16710                 break;
    16711             default:
    16712 -               addch(code | A_ALTCHARSET | attr | COLOR_PAIR(pair));
    16713 +               addch(colored_chtype(code, A_ALTCHARSET | attr, pair));
    16714                 break;
    16715             }
    16716         } while (--count > 0);
    16717 @@ -2969,15 +2989,23 @@
    16718      mvaddstr(0, 20, "Display of the ACS Line-Drawing Set");
    16719      attroff(A_BOLD);
    16720      refresh();
    16721 -    box(stdscr, 0, 0);
    16722      /* *INDENT-OFF* */
    16723 -    mvhline(LINES / 2, 0,        ACS_HLINE | attr, COLS);
    16724 -    mvvline(0,         COLS / 2, ACS_VLINE | attr, LINES);
    16725 -    mvaddch(0,         COLS / 2, ACS_TTEE | attr);
    16726 -    mvaddch(LINES / 2, COLS / 2, ACS_PLUS | attr);
    16727 -    mvaddch(LINES - 1, COLS / 2, ACS_BTEE | attr);
    16728 -    mvaddch(LINES / 2, 0,        ACS_LTEE | attr);
    16729 -    mvaddch(LINES / 2, COLS - 1, ACS_RTEE | attr);
    16730 +    wborder(stdscr,
    16731 +           colored_chtype(ACS_VLINE,    attr, pair),
    16732 +           colored_chtype(ACS_VLINE,    attr, pair),
    16733 +            colored_chtype(ACS_HLINE,    attr, pair),
    16734 +           colored_chtype(ACS_HLINE,    attr, pair),
    16735 +           colored_chtype(ACS_ULCORNER, attr, pair),
    16736 +           colored_chtype(ACS_URCORNER, attr, pair),
    16737 +            colored_chtype(ACS_LLCORNER, attr, pair),
    16738 +           colored_chtype(ACS_LRCORNER, attr, pair));
    16739 +    mvhline(LINES / 2, 0,        colored_chtype(ACS_HLINE, attr, pair), COLS);
    16740 +    mvvline(0,         COLS / 2, colored_chtype(ACS_VLINE, attr, pair), LINES);
    16741 +    mvaddch(0,         COLS / 2, colored_chtype(ACS_TTEE,  attr, pair));
    16742 +    mvaddch(LINES / 2, COLS / 2, colored_chtype(ACS_PLUS,  attr, pair));
    16743 +    mvaddch(LINES - 1, COLS / 2, colored_chtype(ACS_BTEE,  attr, pair));
    16744 +    mvaddch(LINES / 2, 0,        colored_chtype(ACS_LTEE,  attr, pair));
    16745 +    mvaddch(LINES / 2, COLS - 1, colored_chtype(ACS_RTEE,  attr, pair));
    16746      /* *INDENT-ON* */
    16747  
    16748  }
    16749 @@ -3002,7 +3030,7 @@
    16750  {
    16751      int n;
    16752  
    16753 -#define BOTH(name) #name, (name | attr | COLOR_PAIR(pair))
    16754 +#define BOTH(name) #name, colored_chtype(name, attr, pair)
    16755  
    16756      erase();
    16757      attron(A_BOLD);
    16758 @@ -3238,7 +3266,7 @@
    16759      int col = (n / height) * COLS / 2;
    16760  
    16761      mvprintw(row, col, "%*s : ", COLS / 4, name);
    16762 -    while (repeat-- >= 0) {
    16763 +    while (--repeat >= 0) {
    16764         add_wch(code);
    16765      }
    16766      return n + 1;
    16767 @@ -3307,12 +3335,12 @@
    16768  
    16769  #undef MERGE_ATTR
    16770  
    16771 -#define MERGE_ATTR(wch) merge_wide_attr(&temp, wch, attr, pair)
    16772 +#define MERGE_ATTR(n,wch) merge_wide_attr(&temp[n], wch, attr, pair)
    16773  
    16774  static void
    16775  show_wbox_chars(int repeat, attr_t attr, short pair)
    16776  {
    16777 -    cchar_t temp;
    16778 +    cchar_t temp[8];
    16779  
    16780      (void) repeat;
    16781      erase();
    16782 @@ -3321,17 +3349,23 @@
    16783      attroff(A_BOLD);
    16784      refresh();
    16785  
    16786 -    attr_set(attr, pair, 0);
    16787 -    box_set(stdscr, 0, 0);
    16788 -    attr_set(A_NORMAL, 0, 0);
    16789 +    wborder_set(stdscr,
    16790 +               MERGE_ATTR(0, WACS_VLINE),
    16791 +               MERGE_ATTR(1, WACS_VLINE),
    16792 +               MERGE_ATTR(2, WACS_HLINE),
    16793 +               MERGE_ATTR(3, WACS_HLINE),
    16794 +               MERGE_ATTR(4, WACS_ULCORNER),
    16795 +               MERGE_ATTR(5, WACS_URCORNER),
    16796 +               MERGE_ATTR(6, WACS_LLCORNER),
    16797 +               MERGE_ATTR(7, WACS_LRCORNER));
    16798      /* *INDENT-OFF* */
    16799 -    mvhline_set(LINES / 2, 0,        MERGE_ATTR(WACS_HLINE), COLS);
    16800 -    mvvline_set(0,         COLS / 2, MERGE_ATTR(WACS_VLINE), LINES);
    16801 -    mvadd_wch(0,           COLS / 2, MERGE_ATTR(WACS_TTEE));
    16802 -    mvadd_wch(LINES / 2,   COLS / 2, MERGE_ATTR(WACS_PLUS));
    16803 -    mvadd_wch(LINES - 1,   COLS / 2, MERGE_ATTR(WACS_BTEE));
    16804 -    mvadd_wch(LINES / 2,   0,        MERGE_ATTR(WACS_LTEE));
    16805 -    mvadd_wch(LINES / 2,   COLS - 1, MERGE_ATTR(WACS_RTEE));
    16806 +    mvhline_set(LINES / 2, 0,        MERGE_ATTR(0, WACS_HLINE), COLS);
    16807 +    mvvline_set(0,         COLS / 2, MERGE_ATTR(0, WACS_VLINE), LINES);
    16808 +    mvadd_wch(0,           COLS / 2, MERGE_ATTR(0, WACS_TTEE));
    16809 +    mvadd_wch(LINES / 2,   COLS / 2, MERGE_ATTR(0, WACS_PLUS));
    16810 +    mvadd_wch(LINES - 1,   COLS / 2, MERGE_ATTR(0, WACS_BTEE));
    16811 +    mvadd_wch(LINES / 2,   0,        MERGE_ATTR(0, WACS_LTEE));
    16812 +    mvadd_wch(LINES / 2,   COLS - 1, MERGE_ATTR(0, WACS_RTEE));
    16813      /* *INDENT-ON* */
    16814  
    16815  }
    16816 @@ -5804,7 +5838,7 @@
    16817         break;
    16818      case 2:
    16819         init_pair(cpair, COLOR_RED, COLOR_GREEN);
    16820 -       wbkgdset(win, ' ' | A_BLINK | COLOR_PAIR(cpair));
    16821 +       wbkgdset(win, colored_chtype(' ', A_BLINK, cpair));
    16822         break;
    16823      case 3:
    16824         wbkgdset(win, ' ' | A_NORMAL);
    16825 diff -Naur ncurses-5.7.orig/test/programs ncurses-5.7/test/programs
    16826 --- ncurses-5.7.orig/test/programs      2008-08-16 14:47:39.000000000 -0700
    16827 +++ ncurses-5.7/test/programs   2009-01-18 23:56:30.000000000 -0800
    16828 @@ -1,4 +1,4 @@
    16829 -# $Id: programs,v 1.14 2008/08/16 21:47:39 tom Exp $
    16830 +# $Id: programs,v 1.15 2008/12/20 21:38:44 tom Exp $
    16831  ##############################################################################
    16832  # Copyright (c) 2006-2007,2008 Free Software Foundation, Inc.                #
    16833  #                                                                            #
    16834 @@ -35,6 +35,7 @@
    16835  bs             $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   bs
    16836  cardfile       $(LDFLAGS_DEFAULT)      $(LOCAL_LIBS)   cardfile
    16837  chgat          $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   chgat
    16838 +clip_printw    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   clip_printw
    16839  color_set      $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   color_set
    16840  demo_altkeys   $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   demo_altkeys
    16841  demo_defkey    $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   demo_defkey
    16842 @@ -57,6 +58,7 @@
    16843  inch_wide      $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   inch_wide
    16844  inchs          $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   inchs
    16845  ins_wide       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   ins_wide
    16846 +insdelln       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   insdelln
    16847  inserts                $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   inserts
    16848  key_names      $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   key_names
    16849  keynames       $(LDFLAGS_CURSES)       $(LOCAL_LIBS)   keynames
    1685017413diff -Naur ncurses-5.7.orig/test/test.priv.h ncurses-5.7/test/test.priv.h
    1685117414--- ncurses-5.7.orig/test/test.priv.h   2008-10-04 14:53:41.000000000 -0700
    16852 +++ ncurses-5.7/test/test.priv.h        2009-01-18 23:56:30.000000000 -0800
     17415+++ ncurses-5.7/test/test.priv.h        2009-01-27 16:44:52.896037435 -0800
    1685317416@@ -29,7 +29,7 @@
    1685417417 /****************************************************************************
     
    1687017433  * Workaround for HPUX
    1687117434  */
     17435diff -Naur ncurses-5.7.orig/TO-DO ncurses-5.7/TO-DO
     17436--- ncurses-5.7.orig/TO-DO      2008-10-11 12:22:27.000000000 -0700
     17437+++ ncurses-5.7/TO-DO   2009-01-27 16:44:48.051726777 -0800
     17438@@ -25,7 +25,7 @@
     17439 -- sale, use or other dealings in this Software without prior written        --
     17440 -- authorization.                                                            --
     17441 -------------------------------------------------------------------------------
     17442--- $Id: TO-DO,v 1.51 2008/10/11 19:22:27 tom Exp $
     17443+-- $Id: TO-DO,v 1.53 2008/11/28 16:39:12 tom Exp $
     17444 -------------------------------------------------------------------------------
     17445 
     17446 SHORT-TERM TO-DO ITEMS:
     17447@@ -45,7 +45,7 @@
     17448 + Scrolling optimization has holes:  for example, it forces repaints of the
     17449   screen between calls to refresh().
     17450 
     17451-+ SVr4 uses slightly different rules for determining when softkeys are shown.
     17452++ SVr4 uses slightly different rules for determining when softkeys are shown.
     17453   For example, they are initially displayed (before the ncurses 'e' test
     17454   activates them), and a touchwin can apparently also force them to be
     17455   displayed.
     17456@@ -58,7 +58,7 @@
     17457 + The window classes defined in the c++ subdirectory need documentation.  Some
     17458   C++ programmer could earn a lot of good karma by doing this...
     17459 
     17460-+ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
     17461++ vid_attr() should support the set_a_attributes (sgr1) string, but does not.
     17462   There appear to be no terminals that require that functionality.
     17463 
     17464 + the configure --disable-ext-funcs option does not work for Ada95 tree.
     17465@@ -66,6 +66,24 @@
     17466 + the --with-pthread configuration builds for Cygwin, but does not work
     17467   properly (test/worm.c shows all of the worms in the same location).
     17468 
     17469++ the Ada95 tree requires a small fix to build on Cygwin, since the GNAT port
     17470+  to that platform provides an incomplete Interrupts.Names package.  For
     17471+  instance (your gcc version may be different):
     17472+        /usr/lib/gcc/i686-pc-cygwin/3.4.4/adainclude/a-intnam.ads
     17473+
     17474+  cut here...
     17475+-------------------------------------------------------------------------------
     17476+--- a-intnam.ads.orig   2003-10-21 13:41:51.000000000 +0000
     17477++++ a-intnam.ads        2007-05-05 22:40:02.609375000 +0000
     17478+@@ -44,5 +44,6 @@
     17479+
     17480+    DUMMY_INTERRUPT_1 : constant Interrupt_ID := 1;
     17481+    DUMMY_INTERRUPT_2 : constant Interrupt_ID := 2;
     17482++   SIGINT : constant Interrupt_ID := 2;
     17483+
     17484+ end Ada.Interrupts.Names;
     17485+-------------------------------------------------------------------------------
     17486+
     17487 + the --enable-rpath configure option builds for the corresponding platforms;
     17488   however combining it with --with-ticlib and --with-termlib does not always
     17489   produce libraries that can be run without setting environment variables.
     17490@@ -122,7 +140,7 @@
     17491 2. DOS port
     17492 
     17493 Only a few of the files in the library depend on the terminfo format.
     17494-It should be possible to further kernelize the package, then rewrite
     17495+It should be possible to further kernelize the package, then rewrite
     17496 a small number of core files to produce a functionally-compatible
     17497 port that would do updates to a memory-mapped screen area.  The first
     17498 result of this would be a DOS port.
     17499@@ -195,10 +213,10 @@
     17500                move_insert, dest_tabs_magic_smso, transparent_underline,
     17501                needs_xon_xoff, hard_cursor.
     17502        Numerics: lines_of_memory, buttons.
     17503-       Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
     17504-               enter_xon_mode, exit_xon_mode, xon_character, xoff_character,
     17505+       Strings: pkey_key, pkey_local, pkey_xmit, underline_char,
     17506+               enter_xon_mode, exit_xon_mode, xon_character, xoff_character,
     17507                display_clock, remove_clock, user[0-5], display_pc_char,
     17508-               enter_scancode_mode, exit_scancode_mode, pc_term_options,
     17509+               enter_scancode_mode, exit_scancode_mode, pc_term_options,
     17510                scancode_escape, alt_scancode_esc.
     17511 
     17512 These are the potentially important ones for ncurses.  Notes:
Note: See TracChangeset for help on using the changeset viewer.