X-Git-Url: https://git.subgeniuskitty.com/unix-history/.git/blobdiff_plain/31cef89cb428866f787983e68246030321893df4..4b9ccde74dc34e450ed96bcd3d044f78cf393d8d:/usr/src/lib/libcurses/endwin.c diff --git a/usr/src/lib/libcurses/endwin.c b/usr/src/lib/libcurses/endwin.c index f53a773134..67e5cfb618 100644 --- a/usr/src/lib/libcurses/endwin.c +++ b/usr/src/lib/libcurses/endwin.c @@ -1,3 +1,9 @@ +/* + * Clean things up before exiting + * + * 1/26/81 (Berkeley) %W + */ + # include "curses.ext" endwin() @@ -5,9 +11,11 @@ endwin() resetty(); _puts(VE); _puts(TE); - if (curscr->_flags & _STANDOUT) { - _puts(SE); - curscr->_flags &= ~_STANDOUT; + if (curscr) { + if (curscr->_flags & _STANDOUT) { + _puts(SE); + curscr->_flags &= ~_STANDOUT; + } + _endwin = TRUE; } - _endwin = TRUE; }