]> ncurses.scripts.mit.edu Git - ncurses.git/commitdiff
ncurses 5.6 - patch 20070716
authorThomas E. Dickey <dickey@invisible-island.net>
Mon, 16 Jul 2007 22:24:03 +0000 (22:24 +0000)
committerThomas E. Dickey <dickey@invisible-island.net>
Mon, 16 Jul 2007 22:24:03 +0000 (22:24 +0000)
+ restore a call to obtain screen-size in _nc_setupterm(), which
  is used in tput and other non-screen applications via setupterm()
  (Debian #433357, reported by Florent Bayle, Christian Ohm,
  cf: 20070310).

NEWS
dist.mk
ncurses/curses.priv.h
ncurses/tinfo/lib_data.c
ncurses/tinfo/lib_setup.c

diff --git a/NEWS b/NEWS
index f78544e1f24fbd793384763dd7923ae5514ce949..6ff6df5ecced3b14137c863b9b77c8eaaebbd0dd 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.1143 2007/07/14 23:19:06 tom Exp $
+-- $Id: NEWS,v 1.1145 2007/07/16 21:14:00 tom Exp $
 -------------------------------------------------------------------------------
 
 This is a log of changes that ncurses has gone through since Zeyd started
@@ -45,6 +45,12 @@ 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.
 
+20070716
+       + restore a call to obtain screen-size in _nc_setupterm(), which
+         is used in tput and other non-screen applications via setupterm()
+         (Debian #433357, reported by Florent Bayle, Christian Ohm,
+         cf: 20070310).
+
 20070714
        + add test/savescreen.c test-program
        + add check to trace-file open, if the given name is a directory, add
diff --git a/dist.mk b/dist.mk
index 33ff968d3dd88e6dc5f9ff3d76db3c956efb4e62..49a4aa9173af4c33c6d68933d4ce285a6098fb54 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.601 2007/07/14 13:33:27 tom Exp $
+# $Id: dist.mk,v 1.602 2007/07/16 19:48:46 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 = 6
-NCURSES_PATCH = 20070714
+NCURSES_PATCH = 20070716
 
 # We don't append the patch to the version, since this only applies to releases
 VERSION = $(NCURSES_MAJOR).$(NCURSES_MINOR)
index 31fabb1738ca7ead9ad0a97b208435dcd3538d5b..6056ad1126b0da9a0144f68074fede1909b846be 100644 (file)
@@ -34,7 +34,7 @@
 
 
 /*
- * $Id: curses.priv.h,v 1.334 2007/06/09 17:21:53 tom Exp $
+ * $Id: curses.priv.h,v 1.335 2007/07/16 20:32:12 tom Exp $
  *
  *     curses.priv.h
  *
@@ -556,6 +556,8 @@ typedef struct {
        TTY             *saved_tty;     /* savetty/resetty information      */
 #if BROKEN_LINKER || USE_REENTRANT
        chtype          *real_acs_map;
+       int             _LINES;
+       int             _COLS;
 #endif
 } NCURSES_PRESCREEN;
 
index 63b8f644cdb89a4a6c5979872949cc75a6f661c0..40a5a65d5dbdb4cb09edf3bd120e8a13c4b5715a 100644 (file)
@@ -41,7 +41,7 @@
 
 #include <curses.priv.h>
 
-MODULE_ID("$Id: lib_data.c,v 1.26 2007/05/26 18:48:07 tom Exp $")
+MODULE_ID("$Id: lib_data.c,v 1.27 2007/07/16 20:29:04 tom Exp $")
 
 /*
  * OS/2's native linker complains if we don't initialize public data when
@@ -213,6 +213,8 @@ NCURSES_EXPORT_VAR(NCURSES_PRESCREEN) _nc_prescreen = {
     NULL,                      /* saved_tty */
 #if BROKEN_LINKER || USE_REENTRANT
     NULL,                      /* real_acs_map */
+    0,                         /* LINES */
+    0,                         /* COLS */
 #endif
 };
 /* *INDENT-ON* */
index 9a49ee74060c8e25eaf85b00fdc233c0740bd019..90ffda762f5bbc9db8f89a85649a30a63212c032 100644 (file)
@@ -53,7 +53,7 @@
 
 #include <term.h>              /* lines, columns, cur_term */
 
-MODULE_ID("$Id: lib_setup.c,v 1.98 2007/04/21 19:57:42 tom Exp $")
+MODULE_ID("$Id: lib_setup.c,v 1.99 2007/07/16 20:32:27 tom Exp $")
 
 /****************************************************************************
  *
@@ -108,12 +108,12 @@ NCURSES_PUBLIC_VAR(ttytype) (void)
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(LINES) (void)
 {
-    return SP ? SP->_LINES : 0;
+    return (SP ? SP->_LINES : _nc_prescreen._LINES);
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(COLS) (void)
 {
-    return SP ? SP->_COLS : 0;
+    return SP ? SP->_COLS : _nc_prescreen._COLS;
 }
 NCURSES_EXPORT(int)
 NCURSES_PUBLIC_VAR(TABSIZE) (void)
@@ -564,6 +564,16 @@ _nc_setupterm(NCURSES_CONST char *tname, int Filedes, int *errret, bool reuse)
        }
     }
 
+    /*
+     * We should always check the screensize, just in case.
+     */
+#if USE_REENTRANT
+    _nc_get_screensize(SP ? &(SP->_LINES) : &(_nc_prescreen._LINES),
+                      SP ? &(SP->_COLS) : &(_nc_prescreen._COLS));
+#else
+    _nc_get_screensize(&LINES, &COLS);
+#endif
+
     if (errret)
        *errret = TGETENT_YES;