]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.7 - patch 20090516
authorThomas E. Dickey <dickey@invisible-island.net>
Sun, 17 May 2009 00:47:23 +0000 (00:47 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Sun, 17 May 2009 00:47:23 +0000 (00:47 +0000)
+ work around antique BSD game's manipulation of stdscr, etc., versus
  SCREEN's copy of the pointer (Debian #528411).
+ add a cast to wattrset macro to avoid compiler warning when comparing
  its result against ERR (adapted from patch by Matt Kraii, Debian
  #528374).

NEWS
dist.mk
include/curses.h.in
ncurses/base/lib_addch.c
ncurses/tty/tty_update.c

diff --git a/NEWS b/NEWS
index 2903d41b1d43f670b22f432936e387231347856a..7d93054a7c2d78da0a01d2e97e42c2ff4d1e0c98 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.1386 2009/05/10 21:27:04 tom Exp $
+-- $Id: NEWS,v 1.1388 2009/05/17 00:20:31 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,13 @@ 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.
 
+20090516
+       + work around antique BSD game's manipulation of stdscr, etc., versus
+         SCREEN's copy of the pointer (Debian #528411).
+       + add a cast to wattrset macro to avoid compiler warning when comparing
+         its result against ERR (adapted from patch by Matt Kraii, Debian
+         #528374).
+
 20090510
        + continue integrating "sp-funcs" by Juergen Pfeifer (incomplete).
 
diff --git a/dist.mk b/dist.mk
index 8f754ab73f79619ad0256af0c919c7edd38a72b3..de34e5ded2a45b62559023815e3dc75d6cac4add 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.699 2009/05/10 21:27:04 tom Exp $
+# $Id: dist.mk,v 1.700 2009/05/15 23:35:19 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 = 7
-NCURSES_PATCH = 20090510
+NCURSES_PATCH = 20090516
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index b76a5c4da9f0ed5e03b13b492f3ba7832a8ae2ec..665645b22976af0b020699ea2b9d0529eb645a5c 100644 (file)
@@ -32,7 +32,7 @@
  *     and: Thomas E. Dickey                        1996-on                 *
  ****************************************************************************/
 
-/* $Id: curses.h.in,v 1.199 2009/05/09 15:48:04 tom Exp $ */
+/* $Id: curses.h.in,v 1.200 2009/05/16 23:27:59 tom Exp $ */
 
 #ifndef __NCURSES_H
 #define __NCURSES_H
@@ -1093,9 +1093,9 @@ extern NCURSES_EXPORT(int) NCURSES_SP_NAME(use_legacy_coding) (SCREEN*, int);
 #if !NCURSES_OPAQUE
 #if defined(_XOPEN_SOURCE_EXTENDED) && @NCURSES_EXT_COLORS@
 #define wattrset(win,at)       ((win)->_color = PAIR_NUMBER(at), \
-                                (win)->_attrs = (at))
+                                 NCURSES_CAST(int, (win)->_attrs = (at)))
 #else
-#define wattrset(win,at)       ((win)->_attrs = (at))
+#define wattrset(win,at)        NCURSES_CAST(int, (win)->_attrs = (at))
 #endif
 #endif /* NCURSES_OPAQUE */
 
index 714e3e7e562956f8a11bcb1518a623e7d982c948..61248f5d1912ab332a9be9eb3a05200467c76389 100644 (file)
@@ -36,7 +36,7 @@
 #include <curses.priv.h>
 #include <ctype.h>
 
-MODULE_ID("$Id: lib_addch.c,v 1.118 2009/04/18 23:53:04 tom Exp $")
+MODULE_ID("$Id: lib_addch.c,v 1.119 2009/05/15 23:47:26 tom Exp $")
 
 static const NCURSES_CH_T blankchar = NewChar(BLANK_TEXT);
 
@@ -260,10 +260,13 @@ waddch_literal(WINDOW *win, NCURSES_CH_T ch)
     /*
      * Build up multibyte characters until we have a wide-character.
      */
-    if_WIDEC({
 #if NCURSES_SP_FUNCS
-       SCREEN *sp = _nc_screen_of(win);
+#define DeriveSP() SCREEN *sp = _nc_screen_of(win);
+#else
+#define DeriveSP() /*nothing*/
 #endif
+    if_WIDEC({
+       DeriveSP();
        if (WINDOW_EXT(win, addch_used) != 0 || !Charable(ch)) {
            int len = _nc_build_wch(win, CHREF(ch));
 
index 7e99b358eb4e93d796d68fda3d678029b1b7791e..b91053bced85d6e5034fcd5f25e55169a418fe12 100644 (file)
@@ -82,7 +82,7 @@
 
 #include <ctype.h>
 
-MODULE_ID("$Id: tty_update.c,v 1.255 2009/05/10 00:53:14 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.256 2009/05/17 00:13:49 tom Exp $")
 
 /*
  * This define controls the line-breakout optimization.  Every once in a
@@ -668,8 +668,27 @@ NCURSES_SP_NAME(doupdate) (NCURSES_SP_DCL0)
 
     T((T_CALLED("doupdate()")));
 
+#if !USE_REENTRANT
+    /*
+     * It is "legal" but unlikely that an application could assign a new
+     * value to one of the standard windows.  Check for that possibility
+     * and try to recover.
+     *
+     * We do not allow applications to assign new values in the reentrant
+     * model.
+     */
+#define SyncScreens(internal,exported) \
+       if (internal == 0) internal = exported; \
+       if (internal != exported) exported = internal
+
+    SyncScreens(CurScreen(SP_PARM), curscr);
+    SyncScreens(NewScreen(SP_PARM), newscr);
+    SyncScreens(StdScreen(SP_PARM), stdscr);
+#endif
+
     if (CurScreen(SP_PARM) == 0
-       || NewScreen(SP_PARM) == 0)
+       || NewScreen(SP_PARM) == 0
+       || StdScreen(SP_PARM) == 0)
        returnCode(ERR);
 
 #ifdef TRACE