]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - ncurses/tty/tty_update.c
ncurses 5.7 - patch 20081213
[ncurses.git] / ncurses / tty / tty_update.c
index 33c79c7c0d5118d6c756abefe562a4a25e30c72a..6a3a0c8e9341ece94e67edc7ec78db47a5845c82 100644 (file)
@@ -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            *
  *                                                                          *
  * 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>
 
 
 #include <curses.priv.h>
 
+#if defined __HAIKU__ && defined __BEOS__
+#undef __BEOS__
+#endif
+
 #ifdef __BEOS__
 #undef false
 #undef true
 #ifdef __BEOS__
 #undef false
 #undef true
@@ -74,7 +78,7 @@
 #include <ctype.h>
 #include <term.h>
 
 #include <ctype.h>
 #include <term.h>
 
-MODULE_ID("$Id: tty_update.c,v 1.242 2007/09/29 20:37:13 tom Exp $")
+MODULE_ID("$Id: tty_update.c,v 1.246 2008/08/30 20:08:19 tom Exp $")
 
 /*
  * This define controls the line-breakout optimization.  Every once in a
 
 /*
  * This define controls the line-breakout optimization.  Every once in a
@@ -624,6 +628,10 @@ doupdate(void)
 
     T((T_CALLED("doupdate()")));
 
 
     T((T_CALLED("doupdate()")));
 
+    if (curscr == 0
+       || newscr == 0)
+       returnCode(ERR);
+
 #ifdef TRACE
     if (USE_TRACEF(TRACE_UPDATE)) {
        if (curscr->_clear)
 #ifdef TRACE
     if (USE_TRACEF(TRACE_UPDATE)) {
        if (curscr->_clear)
@@ -641,7 +649,7 @@ doupdate(void)
        SP->_fifohold--;
 
 #if USE_SIZECHANGE
        SP->_fifohold--;
 
 #if USE_SIZECHANGE
-    if (SP->_endwin || _nc_handle_sigwinch(FALSE)) {
+    if (SP->_endwin || _nc_handle_sigwinch(SP)) {
        /*
         * This is a transparent extension:  XSI does not address it,
         * and applications need not know that ncurses can do it.
        /*
         * This is a transparent extension:  XSI does not address it,
         * and applications need not know that ncurses can do it.
@@ -650,7 +658,7 @@ doupdate(void)
         * (this can happen in an xterm, for example), and resize the
         * ncurses data structures accordingly.
         */
         * (this can happen in an xterm, for example), and resize the
         * ncurses data structures accordingly.
         */
-       _nc_update_screensize();
+       _nc_update_screensize(SP);
     }
 #endif
 
     }
 #endif