]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/base/lib_screen.c
ncurses 5.6 - patch 20070310
[ncurses.git] / ncurses / base / lib_screen.c
index 43f848d8a64df6e9683f0a962c1abd705754a1d8..e6aecbdaab4782c90742331b1ca3a2c9b3277f9f 100644 (file)
@@ -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            *
 
 #include <curses.priv.h>
 
-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);
     }
 }