]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/ncurses.c
ncurses 5.9 - patch 20110820
[ncurses.git] / test / ncurses.c
index 5a422cf1a8cd5f92f7dbb048f3a7c3749e551e27..ea5f5f867dc4079ca421e154f989f1fa42f1f570 100644 (file)
@@ -40,7 +40,7 @@ AUTHOR
    Author: Eric S. Raymond <esr@snark.thyrsus.com> 1993
            Thomas E. Dickey (beginning revision 1.27 in 1996).
 
-$Id: ncurses.c,v 1.365 2011/01/22 19:48:33 tom Exp $
+$Id: ncurses.c,v 1.369 2011/08/20 15:49:08 tom Exp $
 
 ***************************************************************************/
 
@@ -490,7 +490,7 @@ ShellOut(bool message)
 #ifdef __MINGW32__
     system("cmd.exe");
 #else
-    system("sh");
+    IGNORE_RC(system("sh"));
 #endif
     if (message)
        addstr("returned from shellout.\n");
@@ -777,7 +777,7 @@ resize_boxes(unsigned level, WINDOW *win)
     }
     doupdate();
 }
-#endif /* resize_boxes */
+#endif /* resize_boxes */
 #else
 #define forget_boxes()         /* nothing */
 #define remember_boxes(level,text,frame)       /* nothing */
@@ -1394,7 +1394,7 @@ show_attr(int row, int skip, bool arrow, chtype attr, const char *name)
        if (!(termattrs() & test)) {
            printw(" (N/A)");
        } else {
-           if (ncv > 0 && (getbkgd(stdscr) & A_COLOR)) {
+           if (ncv > 0 && stdscr && (getbkgd(stdscr) & A_COLOR)) {
                static const chtype table[] =
                {
                    A_STANDOUT,
@@ -1675,8 +1675,8 @@ wide_show_attr(int row, int skip, bool arrow, chtype attr, short pair, const cha
            add_wch(&ch);
        }
     } else {
-       attr_t old_attr;
-       short old_pair;
+       attr_t old_attr = 0;
+       short old_pair = 0;
 
        (void) attr_get(&old_attr, &old_pair, 0);
        (void) attr_set(attr, pair, 0);
@@ -4269,8 +4269,10 @@ acs_and_scroll(void)
 
                    neww->next = current ? current->next : 0;
                    neww->last = current;
-                   neww->last->next = neww;
-                   neww->next->last = neww;
+                   if (neww->last != 0)
+                       neww->last->next = neww;
+                   if (neww->next != 0)
+                       neww->next->last = neww;
 
                    neww->wind = getwin(fp);
 
@@ -6772,7 +6774,7 @@ main(int argc, char *argv[])
            use_default_colors();
            min_colors = -1;
        }
-#if NCURSES_VERSION_PATCH >= 20000708
+#if HAVE_ASSUME_DEFAULT_COLORS
        if (assumed_colors)
            assume_default_colors(default_fg, default_bg);
 #endif