X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_restart.c;h=ca27a0fc4c60bcd32dbe34844f002795a5612cf2;hp=31da4b7cb897271672e696cee4160a8a25760389;hb=b6d7123594f6959ad0a6602b3952d9e6abe261a0;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/ncurses/base/lib_restart.c b/ncurses/base/lib_restart.c index 31da4b7c..ca27a0fc 100644 --- a/ncurses/base/lib_restart.c +++ b/ncurses/base/lib_restart.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2000,2002 Free Software Foundation, Inc. * + * Copyright (c) 1998-2002,2006 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 * @@ -29,6 +29,7 @@ /**************************************************************************** * Author: Zeyd M. Ben-Halim 1992,1995 * * and: Eric S. Raymond * + * and: Thomas E. Dickey 1996-on * ****************************************************************************/ /* @@ -47,7 +48,7 @@ #include /* lines, columns, cur_term */ -MODULE_ID("$Id: lib_restart.c,v 1.5 2002/08/31 22:30:10 Philippe.Blain Exp $") +MODULE_ID("$Id: lib_restart.c,v 1.6 2006/01/14 15:58:23 tom Exp $") NCURSES_EXPORT(int) restartterm(NCURSES_CONST char *termp, int filenum, int *errret) @@ -56,37 +57,43 @@ restartterm(NCURSES_CONST char *termp, int filenum, int *errret) 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) - returnCode(ERR); + _nc_handle_sigwinch(0); + if (setupterm(termp, filenum, errret) != OK) { + result = ERR; + } else { - if (saveecho) - echo(); - else - noecho(); + if (saveecho) + echo(); + else + noecho(); - if (savecbreak) { - cbreak(); - noraw(); - } else if (saveraw) { - nocbreak(); - raw(); - } else { - nocbreak(); - noraw(); - } - if (savenl) - nl(); - else - nonl(); + if (savecbreak) { + cbreak(); + noraw(); + } else if (saveraw) { + nocbreak(); + raw(); + } else { + nocbreak(); + noraw(); + } + if (savenl) + nl(); + else + nonl(); - reset_prog_mode(); + reset_prog_mode(); #if USE_SIZECHANGE - _nc_update_screensize(); + _nc_update_screensize(); #endif - returnCode(OK); + result = OK; + } + _nc_handle_sigwinch(1); + returnCode(result); }