From 37393a89d0baca86189de2995545e5ce5fae2bec Mon Sep 17 00:00:00 2001 From: "Todd C. Miller" Date: Sun, 15 Aug 1999 11:41:05 +0000 Subject: Update to ncurses-5.0-990814 --- lib/libcurses/base/lib_addch.c | 8 +++---- lib/libcurses/base/lib_mouse.c | 19 +++-------------- lib/libcurses/base/lib_newterm.c | 10 ++++----- lib/libcurses/base/lib_refresh.c | 13 +++--------- lib/libcurses/base/lib_restart.c | 10 ++++----- lib/libcurses/base/lib_screen.c | 10 ++++----- lib/libcurses/base/lib_set_term.c | 10 ++++----- lib/libcurses/curses.3tbl | 14 ++++++++++--- lib/libcurses/curses.h | 19 +++++++++++++---- lib/libcurses/terminfo.3 | 43 ++++++++++++++++++++++++++------------ lib/libcurses/tinfo/captoinfo.c | 6 +++--- lib/libcurses/tinfo/lib_cur_term.c | 20 +++++++++--------- lib/libcurses/tinfo/lib_termname.c | 14 ++++++------- lib/libcurses/tinfo/lib_ttyflags.c | 6 ++++-- lib/libcurses/tinfo/read_entry.c | 6 +++--- lib/libcurses/tty/lib_tstp.c | 8 ++++--- 16 files changed, 118 insertions(+), 98 deletions(-) (limited to 'lib/libcurses') diff --git a/lib/libcurses/base/lib_addch.c b/lib/libcurses/base/lib_addch.c index cc22401c8ee..5238783668e 100644 --- a/lib/libcurses/base/lib_addch.c +++ b/lib/libcurses/base/lib_addch.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_addch.c,v 1.1 1999/01/18 19:09:34 millert Exp $ */ +/* $OpenBSD: lib_addch.c,v 1.2 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -43,7 +43,7 @@ #include #include -MODULE_ID("$From: lib_addch.c,v 1.41 1998/06/28 00:10:21 tom Exp $") +MODULE_ID("$From: lib_addch.c,v 1.42 1999/07/24 20:01:05 tom Exp $") /* * Ugly microtweaking alert. Everything from here to end of module is @@ -171,8 +171,8 @@ int waddch_nosync(WINDOW *win, const chtype ch) /* the workhorse function -- add a character to the given window */ { int x, y; - int t; - const char *s; + int t = 0; + const char *s = 0; if ((ch & A_ALTCHARSET) || ((t = TextOf(ch)) > 127) diff --git a/lib/libcurses/base/lib_mouse.c b/lib/libcurses/base/lib_mouse.c index 3a7e2851f1b..afc52ef37e9 100644 --- a/lib/libcurses/base/lib_mouse.c +++ b/lib/libcurses/base/lib_mouse.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_mouse.c,v 1.3 1999/05/08 20:29:00 millert Exp $ */ +/* $OpenBSD: lib_mouse.c,v 1.4 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999 Free Software Foundation, Inc. * @@ -87,7 +87,7 @@ #endif #endif -MODULE_ID("$From: lib_mouse.c,v 1.43 1999/04/18 00:37:50 Klaus.Weide Exp $") +MODULE_ID("$From: lib_mouse.c,v 1.44 1999/07/24 21:10:48 tom Exp $") #define MY_TRACE TRACE_ICALLS|TRACE_IEVENT @@ -223,19 +223,6 @@ server_state(const int state) #endif -/* FIXME: The list of names should be configurable */ -static int is_xterm(const char *name) -{ - while (*name != 0) { - if (!strncmp(name, "xterm", 5) - || !strncmp(name, "rxvt", 4) - || !strncmp(name, "kterm", 5)) - return TRUE; - name++; - } - return FALSE; -} - static int initialized; static void _nc_mouse_init(void) @@ -255,7 +242,7 @@ static void _nc_mouse_init(void) /* we know how to recognize mouse events under xterm */ if (key_mouse != 0 - && is_xterm(cur_term->type.term_names)) + && getenv("DISPLAY") != 0) mousetype = M_XTERM; #if USE_GPM_SUPPORT diff --git a/lib/libcurses/base/lib_newterm.c b/lib/libcurses/base/lib_newterm.c index ca2ce25129c..7f6632c4cc8 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.4 1999/06/14 02:29:15 millert Exp $ */ +/* $OpenBSD: lib_newterm.c,v 1.5 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -50,7 +50,7 @@ #include /* clear_screen, cup & friends, cur_term */ -MODULE_ID("$From: lib_newterm.c,v 1.40 1999/06/12 21:30:39 tom Exp $") +MODULE_ID("$From: lib_newterm.c,v 1.41 1999/07/24 20:07:48 tom Exp $") #ifndef ONLCR /* Allows compilation under the QNX 4.2 OS */ #define ONLCR 0 @@ -93,7 +93,7 @@ void filter(void) filter_mode = TRUE; } -SCREEN * newterm(NCURSES_CONST char *term, FILE *ofp, FILE *ifp) +SCREEN * newterm(NCURSES_CONST char *name, FILE *ofp, FILE *ifp) { int errret; int slk_format = _nc_slk_format; @@ -105,10 +105,10 @@ int t = _nc_getenv_num("NCURSES_TRACE"); trace(t); #endif - T((T_CALLED("newterm(\"%s\",%p,%p)"), term, ofp, ifp)); + T((T_CALLED("newterm(\"%s\",%p,%p)"), name, ofp, ifp)); /* this loads the capability entry, then sets LINES and COLS */ - if (setupterm(term, fileno(ofp), &errret) == ERR) + if (setupterm(name, fileno(ofp), &errret) == ERR) return 0; /* implement filter mode */ diff --git a/lib/libcurses/base/lib_refresh.c b/lib/libcurses/base/lib_refresh.c index e841c2ac754..4d1b98cb968 100644 --- a/lib/libcurses/base/lib_refresh.c +++ b/lib/libcurses/base/lib_refresh.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_refresh.c,v 1.1 1999/01/18 19:09:57 millert Exp $ */ +/* $OpenBSD: lib_refresh.c,v 1.2 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -44,7 +44,7 @@ #include -MODULE_ID("$From: lib_refresh.c,v 1.23 1998/06/28 00:10:14 tom Exp $") +MODULE_ID("$From: lib_refresh.c,v 1.24 1999/07/31 11:36:37 juergen Exp $") int wrefresh(WINDOW *win) { @@ -96,14 +96,7 @@ bool wide; begx = win->_begx; begy = win->_begy; - /* - * If 'newscr' has a different background than the window that we're - * trying to refresh, we'll have to copy the whole thing. - */ - if (win->_bkgd != newscr->_bkgd) { - touchwin(win); - newscr->_bkgd = win->_bkgd; - } + newscr->_bkgd = win->_bkgd; newscr->_attrs = win->_attrs; /* merge in change information from all subwindows of this window */ diff --git a/lib/libcurses/base/lib_restart.c b/lib/libcurses/base/lib_restart.c index fb37b368ebd..8f2ae3f91fc 100644 --- a/lib/libcurses/base/lib_restart.c +++ b/lib/libcurses/base/lib_restart.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_restart.c,v 1.1 1999/01/18 19:09:57 millert Exp $ */ +/* $OpenBSD: lib_restart.c,v 1.2 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -49,18 +49,18 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$From: lib_restart.c,v 1.1 1998/12/27 14:40:04 tom Exp $") +MODULE_ID("$From: lib_restart.c,v 1.2 1999/07/24 20:10:04 tom Exp $") -int restartterm(NCURSES_CONST char *term, int filenum, int *errret) +int restartterm(NCURSES_CONST char *termp, int filenum, int *errret) { int saveecho = SP->_echo; int savecbreak = SP->_cbreak; int saveraw = SP->_raw; int savenl = SP->_nl; - T((T_CALLED("restartterm(%s,%d,%p)"), term, filenum, errret)); + T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret)); - setupterm(term, filenum, errret); + setupterm(termp, filenum, errret); if (saveecho) echo(); diff --git a/lib/libcurses/base/lib_screen.c b/lib/libcurses/base/lib_screen.c index a112dc93abc..e7f3a3a9fd7 100644 --- a/lib/libcurses/base/lib_screen.c +++ b/lib/libcurses/base/lib_screen.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_screen.c,v 1.1 1999/01/18 19:09:58 millert Exp $ */ +/* $OpenBSD: lib_screen.c,v 1.2 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -40,7 +40,7 @@ #include #include /* exit_ca_mode, non_rev_rmcup */ -MODULE_ID("$From: lib_screen.c,v 1.14 1999/01/02 22:56:17 tom Exp $") +MODULE_ID("$From: lib_screen.c,v 1.15 1999/07/24 20:05:29 tom Exp $") static time_t dumptime; @@ -127,7 +127,7 @@ int putwin(WINDOW *win, FILE *filep) int scr_restore(const char *file) { - FILE *fp; + FILE *fp = 0; T((T_CALLED("scr_restore(%s)"), _nc_visbuf(file))); @@ -145,7 +145,7 @@ int scr_restore(const char *file) int scr_dump(const char *file) { - FILE *fp; + FILE *fp = 0; T((T_CALLED("scr_dump(%s)"), _nc_visbuf(file))); @@ -163,7 +163,7 @@ int scr_dump(const char *file) int scr_init(const char *file) { - FILE *fp; + FILE *fp = 0; struct stat stb; T((T_CALLED("scr_init(%s)"), _nc_visbuf(file))); diff --git a/lib/libcurses/base/lib_set_term.c b/lib/libcurses/base/lib_set_term.c index 63a3dd87bed..d05dcffb450 100644 --- a/lib/libcurses/base/lib_set_term.c +++ b/lib/libcurses/base/lib_set_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_set_term.c,v 1.3 1999/03/11 21:03:55 millert Exp $ */ +/* $OpenBSD: lib_set_term.c,v 1.4 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -44,16 +44,16 @@ #include /* cur_term */ -MODULE_ID("$From: lib_set_term.c,v 1.45 1999/03/06 22:29:13 tom Exp $") +MODULE_ID("$From: lib_set_term.c,v 1.46 1999/07/24 20:05:49 tom Exp $") -SCREEN * set_term(SCREEN *screen) +SCREEN * set_term(SCREEN *screenp) { SCREEN *oldSP; - T((T_CALLED("set_term(%p)"), screen)); + T((T_CALLED("set_term(%p)"), screenp)); oldSP = SP; - _nc_set_screen(screen); + _nc_set_screen(screenp); set_curterm(SP->_term); curscr = SP->_curscr; diff --git a/lib/libcurses/curses.3tbl b/lib/libcurses/curses.3tbl index 9b1dd66ea8b..9b3e1e12a5f 100644 --- a/lib/libcurses/curses.3tbl +++ b/lib/libcurses/curses.3tbl @@ -1,5 +1,5 @@ -'\" t -.\" $OpenBSD: curses.3tbl,v 1.10 1999/01/21 01:19:56 millert Exp $ +'\" t +.\" $OpenBSD: curses.3tbl,v 1.11 1999/08/15 11:41:03 millert Exp $ .\" .\"*************************************************************************** .\" Copyright (c) 1998 Free Software Foundation, Inc. * @@ -29,7 +29,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: ncurses.3x,v 1.33 1999/01/07 23:22:30 juergen Exp $ +.\" $From: ncurses.3x,v 1.34 1999/07/24 21:37:35 tom Exp $ .TH ncurses 3 "" .ds n 5 .ds d /usr/share/terminfo @@ -545,6 +545,14 @@ a terminal description for terminals which are run as emulations. Use the \fBuse_env\fR function to disable this feature. .TP 5 +DISPLAY +Provides a hint to ncurses that your terminal is an X terminal +emulator such as \fBxterm\fP. +If the \fBkmous\fP capability is set to the beginning of the xterm +mouse response, e.g., "kmous=\\E[M", then ncurses will send the terminal +xterm's mouse initialization strings and allow appropriate replies. +See the \fBcurs_mouse\fR(3) manual page for programming information. +.TP 5 ESCDELAY Specifies the total time, in milliseconds, for which curses will await a character sequence, e.g., a function key. diff --git a/lib/libcurses/curses.h b/lib/libcurses/curses.h index 2e61fff4cad..8aa397b63f1 100644 --- a/lib/libcurses/curses.h +++ b/lib/libcurses/curses.h @@ -1,4 +1,4 @@ -/* $OpenBSD: curses.h,v 1.35 1999/07/11 14:13:46 millert Exp $ */ +/* $OpenBSD: curses.h,v 1.36 1999/08/15 11:41:04 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -33,7 +33,7 @@ * and: Eric S. Raymond * ****************************************************************************/ -/* $From: curses.h.in,v 1.83 1999/06/16 00:25:26 tom Exp $ */ +/* $From: curses.h.in,v 1.84 1999/07/24 20:15:42 tom Exp $ */ #ifndef __NCURSES_H #define __NCURSES_H @@ -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 990710 +#define NCURSES_VERSION_PATCH 990814 /* This is defined in more than one ncurses header, for identification */ #undef NCURSES_VERSION @@ -329,10 +329,21 @@ extern char ttytype[]; /* needed for backward compatibility */ * function calls. Just in case '__attribute__' isn't defined, make a dummy. * G++ doesn't accept it anyway. */ -#if defined(__cplusplus) || (!defined(__GNUC__) && !defined(__attribute__)) +#if !defined(__GNUC__) && !defined(__attribute__) #define __attribute__(p) /* nothing */ #endif +/* + * For g++, turn off our macros that use __attribute__ (g++ recognizes some + * of them, but not at the same version levels as gcc). + */ +#ifdef __cplusplus +#undef GCC_NORETURN +#undef GCC_PRINTF +#undef GCC_SCANF +#undef GCC_UNUSED +#endif + /* * We cannot define these in ncurses_cfg.h, since they require parameters to be * passed (that's non-portable). diff --git a/lib/libcurses/terminfo.3 b/lib/libcurses/terminfo.3 index 2998263e255..b67efcb8bdf 100644 --- a/lib/libcurses/terminfo.3 +++ b/lib/libcurses/terminfo.3 @@ -1,7 +1,7 @@ -.\" $OpenBSD: terminfo.3,v 1.4 1998/11/17 03:51:20 millert Exp $ +.\" $OpenBSD: terminfo.3,v 1.5 1999/08/15 11:41:04 millert Exp $ .\" .\"*************************************************************************** -.\" Copyright (c) 1998 Free Software Foundation, Inc. * +.\" Copyright (c) 1999 Free Software Foundation, Inc. * .\" * .\" Permission is hereby granted, free of charge, to any person obtaining a * .\" copy of this software and associated documentation files (the * @@ -28,7 +28,7 @@ .\" authorization. * .\"*************************************************************************** .\" -.\" $From: curs_terminfo.3x,v 1.10 1998/09/26 12:21:13 tom Exp $ +.\" $From: curs_terminfo.3x,v 1.11 1999/07/31 21:41:29 tom Exp $ .TH terminfo 3 "" .ds n 5 .SH NAME @@ -93,7 +93,7 @@ values for \fBlines\fR and \fBcolumns\fR specified in the The header files \fBcurses.h\fR and \fBterm.h\fR should be included (in this order) to get the definitions for these strings, numbers, and flags. -Parameterized strings should be passed through \fBtparm\fR to instantiate them. +Parameterized strings should be passed through \fBtparm\fR to instantiate them. All \fBterminfo\fR strings [including the output of \fBtparm\fR] should be printed with \fBtputs\fR or \fBputp\fR. Call the \fBreset_shell_mode\fR to restore the tty modes before exiting [see \fBcurs_kernel\fR(3)]. Programs which use @@ -109,13 +109,30 @@ The \fBsetupterm\fR routine reads in the \fBterminfo\fR database, initializing the \fBterminfo\fR structures, but does not set up the output virtualization structures used by \fBcurses\fR. The terminal type is the character string \fIterm\fR; if \fIterm\fR is null, the -environment variable \fBTERM\fR is used. All output is to file -descriptor \fBfildes\fR which is initialized for output. If -\fIerrret\fR is not null, then \fBsetupterm\fR returns \fBOK\fR or +environment variable \fBTERM\fR is used. +All output is to file descriptor \fBfildes\fR which is initialized for output. +If \fIerrret\fR is not null, +then \fBsetupterm\fR returns \fBOK\fR or \fBERR\fR and stores a status value in the integer pointed to by -\fIerrret\fR. A status of \fB1\fR in \fIerrret\fR is normal, \fB0\fR -means that the terminal could not be found, and \fB-1\fR means that -the \fBterminfo\fR database could not be found. If \fIerrret\fR is +\fIerrret\fR. +A return value of \fBOK\fR combined with status of \fB1\fR in \fIerrret\fR +is normal. +If \fBERR\fR is returned, examine \fIerrret\fR: +.RS +.TP 5 +.B 1 +means that the terminal is hardcopy, cannot be used for curses applications. +.TP 5 +.B 0 +means that the terminal could not be found, +or that it is a generic type, +having too little information for curses applications to run. +.TP 5 +.B -1 +means that the \fBterminfo\fR database could not be found. +.RE +.PP +If \fIerrret\fR is null, \fBsetupterm\fR prints an error message upon finding an error and exits. Thus, the simplest call is: @@ -181,15 +198,15 @@ the value of the capability corresponding to the \fBterminfo\fR The \fBtigetflag\fR routine returns the value \fB-1\fR if \fIcapname\fR is not a boolean capability, -or \fB0\fR if it is cancelled or absent from the terminal description. +or \fB0\fR if it is canceled or absent from the terminal description. The \fBtigetnum\fR routine returns the value \fB-2\fR if \fIcapname\fR is not a numeric capability, -or \fB-1\fR if it is cancelled or absent from the terminal description. +or \fB-1\fR if it is canceled or absent from the terminal description. The \fBtigetstr\fR routine returns the value \fB(char *)-1\fR if \fIcapname\fR is not a string capability, -or \fB0\fR if it is cancelled or absent from the terminal description. +or \fB0\fR if it is canceled or absent from the terminal description. The \fIcapname\fR for each capability is given in the table column entitled \fIcapname\fR code in the capabilities section of \fBterminfo\fR(\*n). diff --git a/lib/libcurses/tinfo/captoinfo.c b/lib/libcurses/tinfo/captoinfo.c index 11b7d07e929..74185ae0ccf 100644 --- a/lib/libcurses/tinfo/captoinfo.c +++ b/lib/libcurses/tinfo/captoinfo.c @@ -1,4 +1,4 @@ -/* $OpenBSD: captoinfo.c,v 1.2 1999/03/02 06:23:28 millert Exp $ */ +/* $OpenBSD: captoinfo.c,v 1.3 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -96,7 +96,7 @@ #include #include -MODULE_ID("$From: captoinfo.c,v 1.23 1999/02/28 23:42:20 tom Exp $") +MODULE_ID("$From: captoinfo.c,v 1.24 1999/07/24 20:06:13 tom Exp $") #define MAX_PUSHED 16 /* max # args we can push onto the stack */ #define MAX_ENTRY 2048 /* maximum chars in a translated capability */ @@ -588,7 +588,7 @@ int const parametrized) /* do % translations if 1, pad translations if >=0 */ for (; *str && str != trimmed; str++) { int c1, c2; - char *cp; + char *cp = 0; if (str[0] == '\\' && (str[1] == '^' || str[1] == ',')) { diff --git a/lib/libcurses/tinfo/lib_cur_term.c b/lib/libcurses/tinfo/lib_cur_term.c index 782c1fff767..a7618f95a05 100644 --- a/lib/libcurses/tinfo/lib_cur_term.c +++ b/lib/libcurses/tinfo/lib_cur_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_cur_term.c,v 1.2 1999/03/02 06:23:28 millert Exp $ */ +/* $OpenBSD: lib_cur_term.c,v 1.3 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -42,29 +42,29 @@ #include /* TTY, cur_term */ #include /* ospeed */ -MODULE_ID("$From: lib_cur_term.c,v 1.7 1999/02/22 18:41:09 tom Exp $") +MODULE_ID("$From: lib_cur_term.c,v 1.8 1999/07/24 20:08:19 tom Exp $") TERMINAL *cur_term; -TERMINAL *set_curterm(TERMINAL *term) +TERMINAL *set_curterm(TERMINAL *termp) { TERMINAL *oldterm = cur_term; - if ((cur_term = term) != 0) { + if ((cur_term = termp) != 0) { ospeed = _nc_ospeed(cur_term->_baudrate); PC = (pad_char != NULL) ? pad_char[0] : 0; } return oldterm; } -int del_curterm(TERMINAL *term) +int del_curterm(TERMINAL *termp) { - T((T_CALLED("del_curterm(%p)"), term)); + T((T_CALLED("del_curterm(%p)"), termp)); - if (term != 0) { - _nc_free_termtype(&(term->type)); - free(term); - if (term == cur_term) + if (termp != 0) { + _nc_free_termtype(&(termp->type)); + free(termp); + if (termp == cur_term) cur_term = 0; returnCode(OK); } diff --git a/lib/libcurses/tinfo/lib_termname.c b/lib/libcurses/tinfo/lib_termname.c index dc4e69e2907..ad6353e01e9 100644 --- a/lib/libcurses/tinfo/lib_termname.c +++ b/lib/libcurses/tinfo/lib_termname.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_termname.c,v 1.1 1999/01/18 19:10:20 millert Exp $ */ +/* $OpenBSD: lib_termname.c,v 1.2 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -31,18 +31,18 @@ #include #include /* for MAX_ALIAS */ -MODULE_ID("$From: lib_termname.c,v 1.1 1998/12/19 23:07:43 tom Exp $") +MODULE_ID("$From: lib_termname.c,v 1.2 1999/07/24 21:02:40 tom Exp $") char *termname(void) { -char *term = getenv("TERM"); +char *name = getenv("TERM"); static char ret[MAX_ALIAS+1]; T(("termname() called")); - if (term != 0) { - (void) strncpy(ret, term, sizeof(ret) - 1); - term = ret; + if (name != 0) { + (void) strncpy(ret, name, sizeof(ret) - 1); + name = ret; } - return term; + return name; } diff --git a/lib/libcurses/tinfo/lib_ttyflags.c b/lib/libcurses/tinfo/lib_ttyflags.c index f3b875c3bd4..269c28ea088 100644 --- a/lib/libcurses/tinfo/lib_ttyflags.c +++ b/lib/libcurses/tinfo/lib_ttyflags.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_ttyflags.c,v 1.1 1999/01/18 19:10:21 millert Exp $ */ +/* $OpenBSD: lib_ttyflags.c,v 1.2 1999/08/15 11:40:55 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998 Free Software Foundation, Inc. * @@ -40,7 +40,7 @@ #include #include /* cur_term */ -MODULE_ID("$From: lib_ttyflags.c,v 1.1 1998/12/20 00:49:19 tom Exp $") +MODULE_ID("$From: lib_ttyflags.c,v 1.2 1999/07/24 22:36:12 tom Exp $") #undef tabs @@ -63,6 +63,7 @@ int _nc_get_tty_mode(TTY *buf) if (cur_term == 0 || GET_TTY(cur_term->Filedes, buf) != 0) return(ERR); + TR(TRACE_BITS,("_nc_get_tty_mode: %s", _nc_tracebits())); return (OK); } @@ -71,6 +72,7 @@ int _nc_set_tty_mode(TTY *buf) if (cur_term == 0 || SET_TTY(cur_term->Filedes, buf) != 0) return(ERR); + TR(TRACE_BITS,("_nc_set_tty_mode: %s", _nc_tracebits())); return (OK); } diff --git a/lib/libcurses/tinfo/read_entry.c b/lib/libcurses/tinfo/read_entry.c index 09902edc114..7737580f544 100644 --- a/lib/libcurses/tinfo/read_entry.c +++ b/lib/libcurses/tinfo/read_entry.c @@ -1,4 +1,4 @@ -/* $OpenBSD: read_entry.c,v 1.4 1999/03/02 06:23:29 millert Exp $ */ +/* $OpenBSD: read_entry.c,v 1.5 1999/08/15 11:40:56 millert Exp $ */ /**************************************************************************** * Copyright (c) 1999 Free Software Foundation, Inc. * @@ -49,7 +49,7 @@ #include #include -MODULE_ID("$From: read_entry.c,v 1.60 1999/03/01 23:59:28 tom Exp $") +MODULE_ID("$From: read_entry.c,v 1.61 1999/07/24 20:07:20 tom Exp $") #ifndef O_BINARY #define O_BINARY 0 @@ -366,7 +366,7 @@ static int read_termtype(int fd, TERMTYPE *ptr) int _nc_read_file_entry(const char *const filename, TERMTYPE *ptr) /* return 1 if read, 0 if not found or garbled */ { - int code, fd; + int code, fd = -1; #ifdef __OpenBSD__ if (_nc_read_bsd_terminfo_file(filename, ptr) == 1) diff --git a/lib/libcurses/tty/lib_tstp.c b/lib/libcurses/tty/lib_tstp.c index 6941f460f21..b3c181521ae 100644 --- a/lib/libcurses/tty/lib_tstp.c +++ b/lib/libcurses/tty/lib_tstp.c @@ -1,4 +1,4 @@ -/* $OpenBSD: lib_tstp.c,v 1.3 1999/06/27 08:14:21 millert Exp $ */ +/* $OpenBSD: lib_tstp.c,v 1.4 1999/08/15 11:40:56 millert Exp $ */ /**************************************************************************** * Copyright (c) 1998,1999 Free Software Foundation, Inc. * @@ -50,7 +50,7 @@ #define _POSIX_SOURCE #endif -MODULE_ID("$From: lib_tstp.c,v 1.18 1999/06/19 23:00:06 tom Exp $") +MODULE_ID("$From: lib_tstp.c,v 1.19 1999/07/24 22:47:20 tom Exp $") #if defined(SIGTSTP) && (HAVE_SIGACTION || HAVE_SIGVEC) #define USE_SIGTSTP 1 @@ -122,6 +122,7 @@ static void tstp(int dummy GCC_UNUSED) * parent was stopped before us, and we would likely pick up the * settings already modified by the shell. */ + if (SP != 0 && !SP->_endwin) /* don't do this if we're not in curses */ #if HAVE_TCGETPGRP if (tcgetpgrp(STDIN_FILENO) == getpgrp()) #endif @@ -222,7 +223,8 @@ static void cleanup(int sig) { set_term(scan); endwin(); - SP->_endwin = FALSE; /* in case we have an atexit! */ + if (SP) + SP->_endwin = FALSE; /* in case we have an atexit! */ scan = scan->_next_screen; } } -- cgit v1.2.3