]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/ncurses.c
ncurses 5.9 - patch 20111224
[ncurses.git] / test / ncurses.c
index 83586166a0377a5535eb459a8a733ab09566cef2..d5b5a63fac021f36a8c2a1bba6c395b99c148eaf 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright (c) 1998-2009,2010 Free Software Foundation, Inc.              *
+ * Copyright (c) 1998-2010,2011 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            *
@@ -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.364 2011/01/15 23:45:49 tom Exp $
+$Id: ncurses.c,v 1.370 2011/09/17 21:57:49 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);
@@ -3360,6 +3360,7 @@ show_upper_widechars(int first, int repeat, int space, attr_t attr, short pair)
             * The repeat-count may make text wrap - avoid that.
             */
            getyx(stdscr, y, x);
+           (void) y;
            if (x >= col + (COLS / 2) - 2)
                break;
        } while (--count > 0);
@@ -4269,8 +4270,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 +6775,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