]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/dots_curses.c
ncurses 6.0 - patch 20171125
[ncurses.git] / test / dots_curses.c
index a93fd9bbe537ac3de622698c924d7e59bdad959e..a2025cbe655a5b16e6d5d59b47f341310dcebd71 100644 (file)
@@ -29,7 +29,7 @@
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_curses.c,v 1.10 2017/10/23 08:42:40 tom Exp $
+ * $Id: dots_curses.c,v 1.12 2017/11/24 19:25:28 tom Exp $
  *
  * A simple demo of the curses interface used for comparison with termcap.
  */
@@ -96,7 +96,9 @@ usage(void)
 #if HAVE_USE_DEFAULT_COLORS
        ," -d       invoke use_default_colors()"
 #endif
+#if HAVE_USE_ENV
        ," -e       allow environment $LINES / $COLUMNS"
+#endif
        ," -m SIZE  set margin (default: 2)"
        ," -s MSECS delay 1% of the time (default: 1 msecs)"
     };
@@ -159,7 +161,12 @@ main(int argc, char *argv[])
 #endif
        for (fg = 0; fg < COLORS; fg++) {
            for (bg = 0; bg < COLORS; bg++) {
-               int pair = mypair(fg, bg);
+               int pair;
+               if (interrupted) {
+                   cleanup();
+                   ExitProgram(EXIT_FAILURE);
+               }
+               pair = mypair(fg, bg);
                if (pair > 0)
                    init_pair((short) pair, (short) fg, (short) bg);
            }