X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_endwin.c;h=c3ba37a652327b46bc9a6d0f0147640f9eb21be5;hp=386db4053eddb2d8a9bb6decf34667ae758eeb85;hb=0de8912c1c0746eb37b733e9e6fdf852aab9506a;hpb=78e49873c69dc0494bb34c62f897f8b446584a33;ds=sidebyside diff --git a/ncurses/base/lib_endwin.c b/ncurses/base/lib_endwin.c index 386db405..c3ba37a6 100644 --- a/ncurses/base/lib_endwin.c +++ b/ncurses/base/lib_endwin.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2009 Free Software Foundation, Inc. * + * Copyright (c) 1998-2014,2017 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 * @@ -41,24 +41,33 @@ */ #include -#include -MODULE_ID("$Id: lib_endwin.c,v 1.20 2009/02/15 00:35:00 tom Exp $") +MODULE_ID("$Id: lib_endwin.c,v 1.24 2017/07/22 23:29:40 tom Exp $") NCURSES_EXPORT(int) NCURSES_SP_NAME(endwin) (NCURSES_SP_DCL0) { - T((T_CALLED("endwin()"))); + int code = ERR; + + T((T_CALLED("endwin(%p)"), (void *) SP_PARM)); if (SP_PARM) { - SP_PARM->_endwin = TRUE; +#ifdef USE_TERM_DRIVER + TERMINAL_CONTROL_BLOCK *TCB = TCBOf(SP_PARM); + + SP_PARM->_endwin = ewSuspend; + if (TCB && TCB->drv && TCB->drv->td_scexit) + TCB->drv->td_scexit(SP_PARM); +#else + SP_PARM->_endwin = ewSuspend; SP_PARM->_mouse_wrap(SP_PARM); _nc_screen_wrap(); _nc_mvcur_wrap(); /* wrap up cursor addressing */ - returnCode(reset_shell_mode()); +#endif + code = NCURSES_SP_NAME(reset_shell_mode) (NCURSES_SP_ARG); } - returnCode(ERR); + returnCode(code); } #if NCURSES_SP_FUNCS