X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=ncurses%2Fbase%2Flib_screen.c;h=e6aecbdaab4782c90742331b1ca3a2c9b3277f9f;hp=43f848d8a64df6e9683f0a962c1abd705754a1d8;hb=03a795bde58b3280a4e9d80029a3b7fec13c79ad;hpb=46722468f47c2b77b3987729b4bcf2321cccfd01 diff --git a/ncurses/base/lib_screen.c b/ncurses/base/lib_screen.c index 43f848d8..e6aecbda 100644 --- a/ncurses/base/lib_screen.c +++ b/ncurses/base/lib_screen.c @@ -1,5 +1,5 @@ /**************************************************************************** - * Copyright (c) 1998-2001,2002 Free Software Foundation, Inc. * + * Copyright (c) 1998-2006,2007 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 * @@ -34,10 +34,10 @@ #include -MODULE_ID("$Id: lib_screen.c,v 1.28 2002/09/14 23:30:41 tom Exp $") +MODULE_ID("$Id: lib_screen.c,v 1.30 2007/03/10 23:20:41 tom Exp $") NCURSES_EXPORT(WINDOW *) -getwin(FILE * filep) +getwin(FILE *filep) { WINDOW tmp, *nwin; int n; @@ -70,7 +70,7 @@ getwin(FILE * filep) nwin->_yoffset = tmp._yoffset; nwin->_flags = tmp._flags & ~(_SUBWIN); - nwin->_attrs = tmp._attrs; + WINDOW_ATTRS(nwin) = WINDOW_ATTRS(&tmp); nwin->_nc_bkgd = tmp._nc_bkgd; nwin->_notimeout = tmp._notimeout; @@ -107,7 +107,7 @@ getwin(FILE * filep) } NCURSES_EXPORT(int) -putwin(WINDOW *win, FILE * filep) +putwin(WINDOW *win, FILE *filep) { int code = ERR; int n; @@ -146,7 +146,10 @@ scr_restore(const char *file) returnCode(ERR); } else { delwin(newscr); - SP->_newscr = newscr = getwin(fp); + SP->_newscr = getwin(fp); +#if !USE_REENTRANT + newscr = SP->_newscr; +#endif (void) fclose(fp); returnCode(OK); } @@ -184,7 +187,10 @@ scr_init(const char *file) returnCode(ERR); } else { delwin(curscr); - SP->_curscr = curscr = getwin(fp); + SP->_curscr = getwin(fp); +#if !USE_REENTRANT + curscr = SP->_curscr; +#endif (void) fclose(fp); returnCode(OK); } @@ -199,7 +205,10 @@ scr_set(const char *file) returnCode(ERR); } else { delwin(newscr); - SP->_newscr = newscr = dupwin(curscr); + SP->_newscr = dupwin(curscr); +#if !USE_REENTRANT + newscr = SP->_newscr; +#endif returnCode(OK); } }