apply ncurses-5.9-20120707.patch
authorAnas Nashif <anas.nashif@intel.com>
Fri, 28 Dec 2012 01:23:03 +0000 (17:23 -0800)
committerAnas Nashif <anas.nashif@intel.com>
Fri, 28 Dec 2012 01:23:03 +0000 (17:23 -0800)
13 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
test/demo_termcap.c
test/demo_terminfo.c
test/ncurses.c
test/test_getstr.c

diff --git a/NEWS b/NEWS
index 6517f84..3de16be 100644 (file)
--- a/NEWS
+++ b/NEWS
@@ -25,7 +25,7 @@
 -- sale, use or other dealings in this Software without prior written        --
 -- authorization.                                                            --
 -------------------------------------------------------------------------------
 -- 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
 -------------------------------------------------------------------------------
 
 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.
 
 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).
 20120630
        + add --enable-interop to sample package scripts (suggested by Juergen
          Pfeifer).
diff --git a/dist.mk b/dist.mk
index adcc76e..2d7481e 100644 (file)
--- a/dist.mk
+++ b/dist.mk
@@ -25,7 +25,7 @@
 # use or other dealings in this Software without prior written               #
 # authorization.                                                             #
 ##############################################################################
 # 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
 # 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
 # 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)
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 6c36795..e6f3175 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"), #
 #                                                                            #
 # 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
 #
 #
 # Author: Thomas E. Dickey     1996-on
 #
-term.h
 curses.h
 unctrl.h
 curses.h
 unctrl.h
-termcap.h
 ncurses_dll.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
 
 @ ticlib
 $(srcdir)/tic.h
 $(srcdir)/term_entry.h
 $(srcdir)/nc_tparm.h
 
+# Porting
+@ port_win32con
+ncurses_mingw.h
+
 # vile:makemode
 # vile:makemode
index 2d5d6fd..a8b2ffe 100644 (file)
@@ -1,6 +1,6 @@
 '\" t
 .\"***************************************************************************
 '\" 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            *
 .\"                                                                          *
 .\" 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.                                                           *
 .\"***************************************************************************
 .\"
 .\" 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
 .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.
 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
 .TP 5
 \fBungetch\fP
-returns an error
+returns ERR
 if there is no more room in the FIFO.
 if there is no more room in the FIFO.
-.TP 5
+.TP
 \fBwgetch\fP
 \fBwgetch\fP
-returns an error
+returns ERR
 if the window pointer is null, or
 if its timeout expires without having any data.
 .RE
 if the window pointer is null, or
 if its timeout expires without having any data.
 .RE
index ddb47e7..f8715d3 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            *
 .\"                                                                          *
 .\" 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
 .\"
 .\"
 .\" 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,
 .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.
 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).
 .SH SEE ALSO
 \fBcurs_variables\fR(3X),
 \fBwresize\fR(3X).
index b60242d..aef9401 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            *
  *                                                                          *
  * 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
 
 #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
 
 #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);
 #endif
 #if USE_SIZECHANGE
     sp->_resize = NCURSES_SP_NAME(resizeterm);
+    sp->_ungetch = safe_ungetch;
 #endif
 
     NewScreen(sp)->_clear = TRUE;
 #endif
 
     NewScreen(sp)->_clear = TRUE;
index daa4ae5..03d52a4 100644 (file)
@@ -45,7 +45,7 @@
 #define CUR SP_TERMTYPE
 #endif
 
 #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.
 
 /*
  * 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
            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
            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
        }
            }
 #endif
        }
+#if USE_SIGWINCH
+       safe_ungetch(SP_PARM, KEY_RESIZE);      /* so application can know this */
+#endif
     }
 
     returnCode(result);
     }
 
     returnCode(result);
index 5fbb7b9..1f869a2 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
  *
  *
  *     curses.priv.h
  *
@@ -1159,6 +1159,7 @@ struct screen {
         */
 #if USE_SIZECHANGE
        int             (*_resize)(NCURSES_SP_DCLx int y, int x);
         */
 #if USE_SIZECHANGE
        int             (*_resize)(NCURSES_SP_DCLx int y, int x);
+       int             (*_ungetch)(SCREEN *, int);
 #endif
 
        /*
 #endif
 
        /*
index ab27eb1..166b968 100644 (file)
@@ -47,7 +47,7 @@
 #include <locale.h>
 #endif
 
 #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 (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);
            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;
     }
 }
        sp->_sig_winch = FALSE;
     }
 }
@@ -666,7 +669,7 @@ TINFO_SETUP_TERM(TERMINAL ** tp,
            const TERMTYPE *fallback = _nc_fallback(tname);
 
            if (fallback) {
            const TERMTYPE *fallback = _nc_fallback(tname);
 
            if (fallback) {
-               _nc_copy_termtype(&(termp->type),fallback);
+               _nc_copy_termtype(&(termp->type), fallback);
                status = TGETENT_YES;
            }
        }
                status = TGETENT_YES;
            }
        }
index eede682..6f9c80a 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
 /*
  * 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.
  */
  *
  * 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));
 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;
 }
 
     return result;
 }
 
index fd3362c..8b64869 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
 /*
  * 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.
  */
  *
  * 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));
 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;
 }
 
     return result;
 }
 
index 1314ef3..e17a464 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).
 
    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
 
 #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)
 {
 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();
        } else if (c == 'g') {
            waddstr(win, "getstr test: ");
            echo();
-           wgetnstr(win, buf, sizeof(buf) - 1);
+           c = wgetnstr(win, buf, sizeof(buf) - 1);
            noecho();
            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') {
            wclrtoeol(win);
            wgetch_wrap(win, first_y);
        } else if (c == 'k') {
index a086393..3f64c77 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            *
  *                                                                          *
  * 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.                                                           *
  ****************************************************************************/
 /*
  * 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
  *
  *
  * Author: Thomas E Dickey
  *
@@ -58,6 +58,15 @@ typedef enum {
     eMaxFlavor
 } Flavors;
 
     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)
 {
 static bool
 Quit(int ch)
 {
@@ -310,7 +319,7 @@ test_getstr(int level, char **argv, WINDOW *strwin)
            }
            noecho();
            (void) wattrset(txtwin, A_NORMAL);
            }
            noecho();
            (void) wattrset(txtwin, A_NORMAL);
-           wprintw(strwin, "%d:%s", rc, buffer);
+           wprintw(strwin, "%s:%s", ok_keyname(rc), buffer);
            wnoutrefresh(strwin);
            break;
        default:
            wnoutrefresh(strwin);
            break;
        default: