From: Thomas E. Dickey Date: Mon, 16 Jul 2007 22:24:03 +0000 (+0000) Subject: ncurses 5.6 - patch 20070716 X-Git-Tag: v5.7~59 X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=commitdiff_plain;h=6bbba9cd97d487dc567d06eb8f9131825abe3962 ncurses 5.6 - patch 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). --- diff --git a/NEWS b/NEWS index f78544e1..6ff6df5e 100644 --- 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 33ff968d..49a4aa91 100644 --- 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) diff --git a/ncurses/curses.priv.h b/ncurses/curses.priv.h index 31fabb17..6056ad11 100644 --- a/ncurses/curses.priv.h +++ b/ncurses/curses.priv.h @@ -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; diff --git a/ncurses/tinfo/lib_data.c b/ncurses/tinfo/lib_data.c index 63b8f644..40a5a65d 100644 --- a/ncurses/tinfo/lib_data.c +++ b/ncurses/tinfo/lib_data.c @@ -41,7 +41,7 @@ #include -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* */ diff --git a/ncurses/tinfo/lib_setup.c b/ncurses/tinfo/lib_setup.c index 9a49ee74..90ffda76 100644 --- a/ncurses/tinfo/lib_setup.c +++ b/ncurses/tinfo/lib_setup.c @@ -53,7 +53,7 @@ #include /* 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;