/****************************************************************************
- * 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 *
* Terminfo-only terminal setup routines:
*
* int restartterm(const char *, int, int *)
- * TERMINAL *set_curterm(TERMINAL *)
- * int del_curterm(TERMINAL *)
*/
#include <curses.priv.h>
#include <term.h> /* 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();
reset_prog_mode();
#if USE_SIZECHANGE
- _nc_update_screensize();
+ _nc_update_screensize(SP);
#endif
result = OK;
+ } else {
+ result = ERR;
}
returnCode(result);
}