diff options
author | Todd C. Miller <millert@cvs.openbsd.org> | 1999-07-04 12:43:23 +0000 |
---|---|---|
committer | Todd C. Miller <millert@cvs.openbsd.org> | 1999-07-04 12:43:23 +0000 |
commit | 01b0050483992cef9885e072e5285a13414c45f2 (patch) | |
tree | a9f98382969b8cbc5123d9f9f0b60193f5b9c42e /lib/libcurses | |
parent | 3b9acfa9b1d0142a8988d1467b24822bac011e80 (diff) |
ncurses-5.0-990703 -- better support for mixing termcap and terminfo/curses routines
Diffstat (limited to 'lib/libcurses')
-rw-r--r-- | lib/libcurses/curses.h | 4 | ||||
-rw-r--r-- | lib/libcurses/curses.priv.h | 8 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_options.c | 6 | ||||
-rw-r--r-- | lib/libcurses/tinfo/lib_setup.c | 22 |
4 files changed, 31 insertions, 9 deletions
diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h index cd69f07907a..4a008c6b830 100644 --- a/lib/libcurses/curses.h +++ b/lib/libcurses/curses.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.h,v 1.33 1999/06/27 08:15:19 millert Exp $ */ +/* $OpenBSD: curses.h,v 1.34 1999/07/04 12:43:22 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -50,7 +50,7 @@ /* These are defined only in curses.h, and are used for conditional compiles */ #define NCURSES_VERSION_MAJOR 5 #define NCURSES_VERSION_MINOR 0 -#define NCURSES_VERSION_PATCH 990626 +#define NCURSES_VERSION_PATCH 990703 /* This is defined in more than one ncurses header, for identification */ #undef NCURSES_VERSION diff --git a/lib/libcurses/curses.priv.h b/lib/libcurses/curses.priv.h index 0d88a7ad442..a833421b910 100644 --- a/lib/libcurses/curses.priv.h +++ b/lib/libcurses/curses.priv.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.priv.h,v 1.19 1999/06/27 08:15:19 millert Exp $ */ +/* $OpenBSD: curses.priv.h,v 1.20 1999/07/04 12:43:22 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -35,7 +35,7 @@ /* - * $From: curses.priv.h,v 1.141 1999/06/26 22:00:49 tom Exp $ + * $From: curses.priv.h,v 1.142 1999/07/04 01:21:35 tom Exp $ * * curses.priv.h * @@ -421,6 +421,10 @@ typedef struct { #endif /* usually in <unistd.h> */ +#ifndef STDIN_FILENO +#define STDIN_FILENO 0 +#endif + #ifndef STDOUT_FILENO #define STDOUT_FILENO 1 #endif diff --git a/lib/libcurses/tinfo/lib_options.c b/lib/libcurses/tinfo/lib_options.c index af3d67d0b2d..ed74b5d0269 100644 --- a/lib/libcurses/tinfo/lib_options.c +++ b/lib/libcurses/tinfo/lib_options.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_options.c,v 1.2 1999/02/24 06:31:11 millert Exp $ */ +/* $OpenBSD: lib_options.c,v 1.3 1999/07/04 12:43:16 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -46,7 +46,7 @@ #include <term.h> /* keypad_xmit, keypad_local, meta_on, meta_off */ /* cursor_visible,cursor_normal,cursor_invisible */ -MODULE_ID("$From: lib_options.c,v 1.34 1999/02/18 11:56:16 tom Exp $") +MODULE_ID("$From: lib_options.c,v 1.35 1999/07/04 00:18:28 tom Exp $") int idlok(WINDOW *win, bool flag) { @@ -255,7 +255,7 @@ int _nc_keypad(bool flag) (void) fflush(SP->_ofp); } - if (!SP->_tried) { + if (flag && !SP->_tried) { _nc_init_keytry(); SP->_tried = TRUE; } diff --git a/lib/libcurses/tinfo/lib_setup.c b/lib/libcurses/tinfo/lib_setup.c index 4028790ae70..1248094d301 100644 --- a/lib/libcurses/tinfo/lib_setup.c +++ b/lib/libcurses/tinfo/lib_setup.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_setup.c,v 1.4 1999/06/14 02:29:16 millert Exp $ */ +/* $OpenBSD: lib_setup.c,v 1.5 1999/07/04 12:43:16 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -51,7 +51,7 @@ #include <term.h> /* lines, columns, cur_term */ -MODULE_ID("$From: lib_setup.c,v 1.53 1999/06/12 23:12:12 tom Exp $") +MODULE_ID("$From: lib_setup.c,v 1.54 1999/07/04 01:37:32 tom Exp $") /**************************************************************************** * @@ -338,6 +338,24 @@ int status; ret_error(0, "'%s': unknown terminal type.\n", tname); } + /* + * Improve on SVr4 curses. If an application mixes curses and termcap + * calls, it may call both initscr and tgetent. This is not really a + * good thing to do, but can happen if someone tries using ncurses with + * the readline library. The problem we are fixing is that when + * tgetent calls setupterm, the resulting Ottyb struct in cur_term is + * zeroed. A subsequent call to endwin uses the zeroed terminal + * settings rather than the ones saved in initscr. So we check if + * cur_term appears to contain terminal settings for the same output + * file as our current call - and copy those terminal settings. (SVr4 + * curses does not do this, however applications that are working + * around the problem will still work properly with this feature). + */ + if (cur_term != 0) { + if (cur_term->Filedes == Filedes) + term_ptr->Ottyb = cur_term->Ottyb; + } + set_curterm(term_ptr); if (command_character && getenv("CC")) |