X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_restart.c;h=da770d4e7c9266c1f27c5c3d64926707e216b7a1;hp=31719093140f3d4c7d9f17730db8552ca9fdfe4f;hb=b5df67bc6814f67b5562171c53e3720a30819bba;hpb=7a27c7d49c2e8b4a1ecbe85b4423d647cbc75ea5 diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c index 31719093..da770d4e 100644 --- a/ncurses/base/lib_restart.c +++ b/ncurses/base/lib_restart.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2006,2007 Free Software Foundation, Inc. * + * Copyright (c) 1998-2007,2008 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 * @@ -36,8 +36,6 @@ * Terminfo-only terminal setup routines: * * int restartterm(const char *, int, int *) - * TERMINAL *set_curterm(TERMINAL *) - * int del_curterm(TERMINAL *) */ #include @@ -48,22 +46,22 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_restart.c,v 1.7 2007/04/19 21:05:25 tom Exp $") +MODULE_ID("$Id: lib_restart.c,v 1.10 2008/06/21 17:31:22 tom Exp $") NCURSES_EXPORT(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; int result; T((T_CALLED("restartterm(%s,%d,%p)"), termp, filenum, errret)); if (setupterm(termp, filenum, errret) != OK) { result = ERR; - } else { + } else if (SP != 0) { + int saveecho = SP->_echo; + int savecbreak = SP->_cbreak; + int saveraw = SP->_raw; + int savenl = SP->_nl; if (saveecho) echo(); @@ -88,10 +86,12 @@ restartterm(NCURSES_CONST char *termp, int filenum, int *errret) reset_prog_mode(); #if USE_SIZECHANGE - _nc_update_screensize(); + _nc_update_screensize(SP); #endif result = OK; + } else { + result = ERR; } returnCode(result); }