]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.9 - patch 20120707
authorThomas E. Dickey <dickey@invisible-island.net>
Sat, 7 Jul 2012 23:45:45 +0000 (23:45 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sat, 7 Jul 2012 23:45:45 +0000 (23:45 +0000)
+ add ncurses_mingw.h to installed headers (prompted by patch by
  Juergen Pfeifer).
+ clarify return-codes from wgetch() in response to SIGWINCH (prompted
  by Novell #769788).
+ modify resizeterm() to always push a KEY_RESIZE onto the fifo, even
  if screensize is unchanged.  Modify _nc_update_screensize() to push a
  KEY_RESIZE if there was a SIGWINCH, even if it does not call
  resizeterm().  These changes eliminate the case where a SIGWINCH is
  received, but ERR returned from wgetch or wgetnstr because the screen
  dimensions did not change (Novell #769788).

15 files changed:
NEWS
dist.mk
include/headers
man/curs_getch.3x
man/resizeterm.3x
ncurses/base/lib_set_term.c
ncurses/base/resizeterm.c
ncurses/curses.priv.h
ncurses/tinfo/lib_setup.c
package/debian/changelog
package/ncurses.spec
test/demo_termcap.c
test/demo_terminfo.c
test/ncurses.c
test/test_getstr.c

diff --git a/NEWS b/NEWS
index 6517f84d08369a59445f257d336465b7e3eb72de..3de16bece91682c6f929a388698624b85fcf7c74 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
--- $Id: NEWS,v 1.1923 2012/06/30 23:05:08 tom Exp $
+-- $Id: NEWS,v 1.1926 2012/07/07 19:59:58 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,18 @@ See the AUTHORS file for the corresponding full names.
 Changes through 1.9.9e did not credit all contributions;
 it is not possible to add this information.
 
+20120707
+       + add ncurses_mingw.h to installed headers (prompted by patch by
+         Juergen Pfeifer).
+       + clarify return-codes from wgetch() in response to SIGWINCH (prompted
+         by Novell #769788).
+       + modify resizeterm() to always push a KEY_RESIZE onto the fifo, even
+         if screensize is unchanged.  Modify _nc_update_screensize() to push a
+         KEY_RESIZE if there was a SIGWINCH, even if it does not call
+         resizeterm().  These changes eliminate the case where a SIGWINCH is
+         received, but ERR returned from wgetch or wgetnstr because the screen
+         dimensions did not change (Novell #769788).
+
 20120630
        + add --enable-interop to sample package scripts (suggested by Juergen
          Pfeifer).
diff --git a/dist.mk b/dist.mk
index adcc76ea920aeac82cfb71fcbd3e0480f5ed2fd1..2d7481e7097793f10e23936211407f345ecaf1b7 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
-# $Id: dist.mk,v 1.880 2012/06/30 16:22:52 tom Exp $
+# $Id: dist.mk,v 1.881 2012/07/07 16:02:13 tom Exp $
 # Makefile for creating ncurses distributions.
 #
 # This only needs to be used directly as a makefile by developers, but
@@ -37,7 +37,7 @@ SHELL = /bin/sh
 # These define the major/minor/patch versions of ncurses.
 NCURSES_MAJOR = 5
 NCURSES_MINOR = 9
-NCURSES_PATCH = 20120630
+NCURSES_PATCH = 20120707
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 6c367950c9f427fd7c669a6d5115286e134ee0bb..e6f3175276562970470a1f817c0522152a83c0d9 100644 (file)
@@ -1,6 +1,6 @@
-# $Id: headers,v 1.10 2009/09/05 17:46:30 tom Exp $
+# $Id: headers,v 1.11 2012/07/07 19:58:24 tom Exp $
 ##############################################################################
-# Copyright (c) 1998-2007,2009 Free Software Foundation, Inc.                #
+# Copyright (c) 1998-2009,2012 Free Software Foundation, Inc.                #
 #                                                                            #
 # Permission is hereby granted, free of charge, to any person obtaining a    #
 # copy of this software and associated documentation files (the "Software"), #
 #
 # Author: Thomas E. Dickey     1996-on
 #
-term.h
 curses.h
 unctrl.h
-termcap.h
 ncurses_dll.h
+
+# Support for termcap (and tic, etc.), which can be a separate library
+@ termlib
+term.h
+termcap.h
+
+# Headers used only for tic, other programs using internal interfaces
 @ ticlib
 $(srcdir)/tic.h
 $(srcdir)/term_entry.h
 $(srcdir)/nc_tparm.h
 
+# Porting
+@ port_win32con
+ncurses_mingw.h
+
 # vile:makemode
index 2d5d6fda785ff4e910afac7cc7ec8c1d347510ad..a8b2ffea1868a70e8dd1c4b901535f394bb7e6a8 100644 (file)
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
-.\" Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -27,7 +27,7 @@
 .\" authorization.                                                           *
 .\"***************************************************************************
 .\"
-.\" $Id: curs_getch.3x,v 1.36 2011/01/22 19:38:51 tom Exp $
+.\" $Id: curs_getch.3x,v 1.37 2012/07/07 20:04:56 tom Exp $
 .TH curs_getch 3X ""
 .na
 .hy 0
@@ -237,14 +237,14 @@ See \fBresizeterm\fR(3X) for more details about \fBKEY_RESIZE\fP, and
 All routines return the integer \fBERR\fR upon failure and an integer value
 other than \fBERR\fR (\fBOK\fR in the case of ungetch()) upon successful
 completion.
-.RS
+.RS 3
 .TP 5
 \fBungetch\fP
-returns an error
+returns ERR
 if there is no more room in the FIFO.
-.TP 5
+.TP
 \fBwgetch\fP
-returns an error
+returns ERR
 if the window pointer is null, or
 if its timeout expires without having any data.
 .RE
index ddb47e76bf92aa43c72ce455fabfb964ba9ceb43..f8715d35374c2274119ff6fdad453be7e94a8fb3 100644 (file)
@@ -1,5 +1,5 @@
 .\"***************************************************************************
-.\" Copyright (c) 1998-2005,2010 Free Software Foundation, Inc.              *
+.\" Copyright (c) 1998-2010,2012 Free Software Foundation, Inc.              *
 .\"                                                                          *
 .\" Permission is hereby granted, free of charge, to any person obtaining a  *
 .\" copy of this software and associated documentation files (the            *
@@ -28,7 +28,7 @@
 .\"
 .\" Author: Thomas E. Dickey 1996-2005
 .\"
-.\" $Id: resizeterm.3x,v 1.14 2010/12/04 18:38:55 tom Exp $
+.\" $Id: resizeterm.3x,v 1.15 2012/07/07 18:38:21 tom Exp $
 .TH resizeterm 3X ""
 .SH NAME
 \fBis_term_resized\fR,
@@ -86,8 +86,6 @@ this overrides the library's use of the window size obtained from
 the operating system.
 Thus, even if a SIGWINCH is received,
 no screen size change may be recorded.
-In that case, no \fBKEY_RESIZE\fP is queued for the next call to \fBgetch\fP;
-an \fBERR\fP will be returned instead.
 .SH SEE ALSO
 \fBcurs_variables\fR(3X),
 \fBwresize\fR(3X).
index b60242ded6d66b71597e0480453badcd65c803aa..aef940122b95782b67fbac2450f6a52a35337230 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2010,2011 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2011,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -47,7 +47,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: lib_set_term.c,v 1.140 2011/10/22 16:10:43 tom Exp $")
+MODULE_ID("$Id: lib_set_term.c,v 1.141 2012/07/07 20:37:40 tom Exp $")
 
 #ifdef USE_TERM_DRIVER
 #define MaxColors      InfoOf(sp).maxcolors
@@ -619,6 +619,7 @@ NCURSES_SP_NAME(_nc_setupscreen) (
 #endif
 #if USE_SIZECHANGE
     sp->_resize = NCURSES_SP_NAME(resizeterm);
+    sp->_ungetch = safe_ungetch;
 #endif
 
     NewScreen(sp)->_clear = TRUE;
index daa4ae54ab64bd78432dd561a44edecece0aec46..03d52a448b0937fb7ab4900f8134400e995115f7 100644 (file)
@@ -45,7 +45,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
-MODULE_ID("$Id: resizeterm.c,v 1.44 2011/09/03 18:29:11 tom Exp $")
+MODULE_ID("$Id: resizeterm.c,v 1.45 2012/07/07 17:07:23 tom Exp $")
 
 /*
  * If we're trying to be reentrant, do not want any local statics.
@@ -484,7 +484,6 @@ NCURSES_SP_NAME(resizeterm) (NCURSES_SP_DCLx int ToLines, int ToCols)
            result = NCURSES_SP_NAME(resize_term) (NCURSES_SP_ARGx ToLines, ToCols);
 
 #if USE_SIGWINCH
-           safe_ungetch(SP_PARM, KEY_RESIZE);  /* so application can know this */
            clearok(CurScreen(SP_PARM), TRUE);  /* screen contents are unknown */
 
            /* ripped-off lines are a special case: if we did not lengthen
@@ -514,6 +513,9 @@ NCURSES_SP_NAME(resizeterm) (NCURSES_SP_DCLx int ToLines, int ToCols)
            }
 #endif
        }
+#if USE_SIGWINCH
+       safe_ungetch(SP_PARM, KEY_RESIZE);      /* so application can know this */
+#endif
     }
 
     returnCode(result);
index 5fbb7b9ae692c7b5e67bc621610426ce715bbe39..1f869a2cb03c2fce23925df66f5c2b51a81b16bd 100644 (file)
@@ -34,7 +34,7 @@
  ****************************************************************************/
 
 /*
- * $Id: curses.priv.h,v 1.499 2012/03/10 21:16:32 tom Exp $
+ * $Id: curses.priv.h,v 1.501 2012/07/07 20:47:07 tom Exp $
  *
  *     curses.priv.h
  *
@@ -1159,6 +1159,7 @@ struct screen {
         */
 #if USE_SIZECHANGE
        int             (*_resize)(NCURSES_SP_DCLx int y, int x);
+       int             (*_ungetch)(SCREEN *, int);
 #endif
 
        /*
index ab27eb1d8eb90f5719376bc3195de017ef392c6f..166b9689813a16a8d6922dbeb58cdc0732983881 100644 (file)
@@ -47,7 +47,7 @@
 #include <locale.h>
 #endif
 
-MODULE_ID("$Id: lib_setup.c,v 1.143 2012/02/29 11:50:19 Werner.Fink Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.145 2012/07/07 20:35:27 tom Exp $")
 
 /****************************************************************************
  *
@@ -399,8 +399,11 @@ _nc_update_screensize(SCREEN *sp)
      */
     if (sp != 0
        && sp->_resize != 0) {
-       if ((new_lines != old_lines) || (new_cols != old_cols))
+       if ((new_lines != old_lines) || (new_cols != old_cols)) {
            sp->_resize(NCURSES_SP_ARGx new_lines, new_cols);
+       } else if (sp->_sig_winch && (sp->_ungetch != 0)) {
+           sp->_ungetch(SP_PARM, KEY_RESIZE);  /* so application can know this */
+       }
        sp->_sig_winch = FALSE;
     }
 }
@@ -666,7 +669,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp,
            const TERMTYPE *fallback = _nc_fallback(tname);
 
            if (fallback) {
-               _nc_copy_termtype(&(termp->type),fallback);
+               _nc_copy_termtype(&(termp->type), fallback);
                status = TGETENT_YES;
            }
        }
index 326573e24d20afd041ccae7ae251b6bd82df5c62..9be8c66cb541c2ae6913266b837776cda9c72e46 100644 (file)
@@ -1,8 +1,8 @@
-ncurses6 (5.9-20120630) unstable; urgency=low
+ncurses6 (5.9-20120707) unstable; urgency=low
 
   * latest weekly patch
 
- -- Thomas E. Dickey <dickey@invisible-island.net>  Fri, 22 Jun 2012 13:52:38 -0400
+ -- Thomas E. Dickey <dickey@invisible-island.net>  Sat, 07 Jul 2012 16:41:06 -0400
 
 ncurses6 (5.9-20120608) unstable; urgency=low
 
index df23a15e498c9b59c0fca249106164448d00e67d..df9500e5e5b4a59d7b655f387f0d9d9845851281 100644 (file)
@@ -1,7 +1,7 @@
 Summary: shared libraries for terminal handling
 Name: ncurses6
 Release: 5.9
-Version: 20120630
+Version: 20120707
 License: X11
 Group: Development/Libraries
 Source: ncurses-%{release}-%{version}.tgz
index eede682fdbe8be28b1801fef937118e599991ff0..6f9c80a9c6c33bf5e51339d7d3da408453cc7451 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_termcap.c,v 1.21 2012/06/30 22:02:56 tom Exp $
+ * $Id: demo_termcap.c,v 1.22 2012/07/07 23:37:27 tom Exp $
  *
  * A simple demo of the termcap interface.
  */
@@ -89,7 +89,7 @@ static char *
 make_dbitem(char *p, char *q)
 {
     char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
-    sprintf(result, "%s=%.*s", e_opt, p - q, q);
+    sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
     return result;
 }
 
index fd3362c2df2c81b594c282d892def57ab7688902..8b64869f1c2aae4e35e3540a5a7ae36abc475f3e 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: demo_terminfo.c,v 1.12 2012/06/30 22:03:22 tom Exp $
+ * $Id: demo_terminfo.c,v 1.13 2012/07/07 23:37:13 tom Exp $
  *
  * A simple demo of the terminfo interface.
  */
@@ -70,7 +70,7 @@ static char *
 make_dbitem(char *p, char *q)
 {
     char *result = malloc(strlen(e_opt) + 2 + (size_t) (p - q));
-    sprintf(result, "%s=%.*s", e_opt, p - q, q);
+    sprintf(result, "%s=%.*s", e_opt, (int) (p - q), q);
     return result;
 }
 
index 1314ef3e16b187bffbe7f964fd6900ce608ff0a1..e17a4649f57286c6d5eb654921dff685715b797d 100644 (file)
@@ -40,7 +40,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.371 2012/06/09 20:30:32 tom Exp $
+$Id: ncurses.c,v 1.372 2012/07/07 18:09:38 tom Exp $
 
 ***************************************************************************/
 
@@ -783,6 +783,15 @@ resize_boxes(unsigned level, WINDOW *win)
 #define remember_boxes(level,text,frame)       /* nothing */
 #endif
 
+/*
+ * Return-code is OK/ERR or a keyname.
+ */
+static const char *
+ok_keyname(int code)
+{
+    return ((code == OK) ? "OK" : ((code == ERR) ? "ERR" : keyname(code)));
+}
+
 static void
 wgetch_test(unsigned level, WINDOW *win, int delay)
 {
@@ -824,9 +833,11 @@ wgetch_test(unsigned level, WINDOW *win, int delay)
        } else if (c == 'g') {
            waddstr(win, "getstr test: ");
            echo();
-           wgetnstr(win, buf, sizeof(buf) - 1);
+           c = wgetnstr(win, buf, sizeof(buf) - 1);
            noecho();
-           wprintw(win, "I saw %d characters:\n\t`%s'.", (int) strlen(buf), buf);
+           wprintw(win, "I saw %d characters:\n\t`%s' (%s).",
+                   (int) strlen(buf), buf,
+                   ok_keyname(c));
            wclrtoeol(win);
            wgetch_wrap(win, first_y);
        } else if (c == 'k') {
index a0863937886be88ce551cdaa10b94e6c3a72806c..3f64c77b4858cb20931a0f62d85d10606bb58892 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 2007-2008,2009 Free Software Foundation, Inc.              *
+ * Copyright (c) 2007-2009,2012 Free Software Foundation, Inc.              *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
  * copy of this software and associated documentation files (the            *
@@ -26,7 +26,7 @@
  * authorization.                                                           *
  ****************************************************************************/
 /*
- * $Id: test_getstr.c,v 1.9 2009/08/29 19:02:25 tom Exp $
+ * $Id: test_getstr.c,v 1.10 2012/07/07 18:22:49 tom Exp $
  *
  * Author: Thomas E Dickey
  *
@@ -58,6 +58,15 @@ typedef enum {
     eMaxFlavor
 } Flavors;
 
+/*
+ * Return-code is OK/ERR or a keyname.
+ */
+static const char *
+ok_keyname(int code)
+{
+    return ((code == OK) ? "OK" : ((code == ERR) ? "ERR" : keyname(code)));
+}
+
 static bool
 Quit(int ch)
 {
@@ -310,7 +319,7 @@ test_getstr(int level, char **argv, WINDOW *strwin)
            }
            noecho();
            (void) wattrset(txtwin, A_NORMAL);
-           wprintw(strwin, "%d:%s", rc, buffer);
+           wprintw(strwin, "%s:%s", ok_keyname(rc), buffer);
            wnoutrefresh(strwin);
            break;
        default: