summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorTodd C. Miller <millert@cvs.openbsd.org>1999-06-14 02:29:17 +0000
committerTodd C. Miller <millert@cvs.openbsd.org>1999-06-14 02:29:17 +0000
commit1ab49343078e91ce5220fbaa02855c4785b491c4 (patch)
treef2eed65a80129b823b3ca6306102052a04283550 /lib
parent2566c87b178ae7078d4b49440ef2c6a3901e149e (diff)
ncurses-5.0-990612
Diffstat (limited to 'lib')
-rw-r--r--lib/libcurses/base/lib_endwin.c7
-rw-r--r--lib/libcurses/base/lib_newterm.c33
-rw-r--r--lib/libcurses/tinfo/lib_setup.c6
-rw-r--r--lib/libcurses/tty/lib_vidattr.c17
4 files changed, 34 insertions, 29 deletions
diff --git a/lib/libcurses/base/lib_endwin.c b/lib/libcurses/base/lib_endwin.c
index 5ebe5a11323..1a6614a3ebc 100644
--- a/lib/libcurses/base/lib_endwin.c
+++ b/lib/libcurses/base/lib_endwin.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_endwin.c,v 1.1 1999/01/18 19:09:42 millert Exp $ */
+/* $OpenBSD: lib_endwin.c,v 1.2 1999/06/14 02:29:15 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -44,7 +44,7 @@
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$From: lib_endwin.c,v 1.16 1998/09/20 03:29:17 tom Exp $")
+MODULE_ID("$From: lib_endwin.c,v 1.17 1999/06/12 23:01:46 tom Exp $")
int
endwin(void)
@@ -56,7 +56,8 @@ endwin(void)
SP->_mouse_wrap(SP);
_nc_screen_wrap();
_nc_mvcur_wrap(); /* wrap up cursor addressing */
+ returnCode(reset_shell_mode());
}
- returnCode(reset_shell_mode());
+ returnCode(ERR);
}
diff --git a/lib/libcurses/base/lib_newterm.c b/lib/libcurses/base/lib_newterm.c
index ad9819fe8dc..ca2ce25129c 100644
--- a/lib/libcurses/base/lib_newterm.c
+++ b/lib/libcurses/base/lib_newterm.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_newterm.c,v 1.3 1999/03/11 21:03:55 millert Exp $ */
+/* $OpenBSD: lib_newterm.c,v 1.4 1999/06/14 02:29:15 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -50,7 +50,7 @@
#include <term.h> /* clear_screen, cup & friends, cur_term */
-MODULE_ID("$From: lib_newterm.c,v 1.39 1999/03/03 23:44:22 juergen Exp $")
+MODULE_ID("$From: lib_newterm.c,v 1.40 1999/06/12 21:30:39 tom Exp $")
#ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */
#define ONLCR 0
@@ -111,22 +111,6 @@ int t = _nc_getenv_num("NCURSES_TRACE");
if (setupterm(term, fileno(ofp), &errret) == ERR)
return 0;
- /*
- * Check for mismatched graphic-rendition capabilities. Most SVr4
- * terminfo trees contain entries that have rmul or rmso equated to
- * sgr0 (Solaris curses copes with those entries). We do this only for
- * curses, since many termcap applications assume that smso/rmso and
- * smul/rmul are paired, and will not function properly if we remove
- * rmso or rmul. Curses applications shouldn't be looking at this
- * detail.
- */
- if (exit_attribute_mode) {
-#define SGR0_FIX(mode) if (mode != 0 && !strcmp(mode, exit_attribute_mode)) \
- mode = 0
- SGR0_FIX(exit_underline_mode);
- SGR0_FIX(exit_standout_mode);
- }
-
/* implement filter mode */
if (filter_mode) {
LINES = 1;
@@ -195,6 +179,19 @@ int t = _nc_getenv_num("NCURSES_TRACE");
SP->_keytry = 0;
+ /*
+ * Check for mismatched graphic-rendition capabilities. Most SVr4
+ * terminfo trees contain entries that have rmul or rmso equated to
+ * sgr0 (Solaris curses copes with those entries). We do this only for
+ * curses, since many termcap applications assume that smso/rmso and
+ * smul/rmul are paired, and will not function properly if we remove
+ * rmso or rmul. Curses applications shouldn't be looking at this
+ * detail.
+ */
+#define SGR0_TEST(mode) (mode != 0) && (exit_attribute_mode == 0 || strcmp(mode, exit_attribute_mode))
+ SP->_use_rmso = SGR0_TEST(exit_standout_mode);
+ SP->_use_rmul = SGR0_TEST(exit_underline_mode);
+
/* compute movement costs so we can do better move optimization */
_nc_mvcur_init();
diff --git a/lib/libcurses/tinfo/lib_setup.c b/lib/libcurses/tinfo/lib_setup.c
index f496c05f992..4028790ae70 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.3 1999/03/02 06:23:29 millert Exp $ */
+/* $OpenBSD: lib_setup.c,v 1.4 1999/06/14 02:29: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.51 1999/02/27 22:13:00 tom Exp $")
+MODULE_ID("$From: lib_setup.c,v 1.53 1999/06/12 23:12:12 tom Exp $")
/****************************************************************************
*
@@ -291,7 +291,7 @@ int setupterm(NCURSES_CONST char *tname, int Filedes, int *errret)
struct term *term_ptr;
int status;
- T((T_CALLED("setupterm(\"%s\",%d,%p)"), tname, Filedes, errret));
+ T((T_CALLED("setupterm(%s,%d,%p)"), _nc_visbuf(tname), Filedes, errret));
if (tname == 0) {
tname = getenv("TERM");
diff --git a/lib/libcurses/tty/lib_vidattr.c b/lib/libcurses/tty/lib_vidattr.c
index b148877d992..9db4ee5aec9 100644
--- a/lib/libcurses/tty/lib_vidattr.c
+++ b/lib/libcurses/tty/lib_vidattr.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: lib_vidattr.c,v 1.1 1999/01/18 19:10:27 millert Exp $ */
+/* $OpenBSD: lib_vidattr.c,v 1.2 1999/06/14 02:29:16 millert Exp $ */
/****************************************************************************
* Copyright (c) 1998 Free Software Foundation, Inc. *
@@ -66,7 +66,7 @@
#include <curses.priv.h>
#include <term.h>
-MODULE_ID("$From: lib_vidattr.c,v 1.21 1998/08/01 22:21:19 tom Exp $")
+MODULE_ID("$From: lib_vidattr.c,v 1.23 1999/06/12 21:20:41 tom Exp $")
#define doPut(mode) TPUTS_TRACE(#mode); tputs(mode, 1, outc)
@@ -104,7 +104,8 @@ bool used_ncv = FALSE;
T(("previous attribute was %s", _traceattr(previous_attr)));
#if !USE_XMC_SUPPORT
- if (magic_cookie_glitch > 0)
+ if ((SP != 0)
+ && (magic_cookie_glitch > 0))
newmode &= ~(SP->_xmc_suppress);
#endif
@@ -187,8 +188,14 @@ bool used_ncv = FALSE;
T(("turning %s off", _traceattr(turn_off)));
TurnOff(A_ALTCHARSET, exit_alt_charset_mode);
- TurnOff(A_UNDERLINE, exit_underline_mode);
- TurnOff(A_STANDOUT, exit_standout_mode);
+
+ if (!SP || SP->_use_rmul) {
+ TurnOff(A_UNDERLINE, exit_underline_mode);
+ }
+
+ if (!SP || SP->_use_rmso) {
+ TurnOff(A_STANDOUT, exit_standout_mode);
+ }
if (turn_off && exit_attribute_mode) {
doPut(exit_attribute_mode);