X-Git-Url: https://ncurses.scripts.mit.edu/?p=ncurses.git;a=blobdiff_plain;f=test%2Fview.c;fp=test%2Fview.c;h=e24628e2fb263f4b1e66e46ecfd1db9d94e81813;hp=1f960b9aa2b846affa5d54bc610176057b2becfd;hb=12b49d3c56a6130feb2d39fbe2d6c1bc0838f0fa;hpb=93ed44d781ca36f55021e0ad55f1ce33de62f7ba diff --git a/test/view.c b/test/view.c index 1f960b9a..e24628e2 100644 --- a/test/view.c +++ b/test/view.c @@ -50,7 +50,7 @@ * scroll operation worked, and the refresh() code only had to do a * partial repaint. * - * $Id: view.c,v 1.102 2017/09/04 00:39:24 tom Exp $ + * $Id: view.c,v 1.104 2017/09/30 17:50:38 tom Exp $ */ #include @@ -259,6 +259,7 @@ main(int argc, char *argv[]) int value = 0; bool done = FALSE; bool got_number = FALSE; + bool ignore_sigs = FALSE; bool single_step = FALSE; #if CAN_RESIZE bool nonposix_resize = FALSE; @@ -281,7 +282,7 @@ main(int argc, char *argv[]) try_color = TRUE; break; case 'i': - CATCHALL(SIG_IGN); + ignore_sigs = TRUE; break; case 'n': if ((MAXLINES = atoi(optarg)) < 1 || @@ -388,7 +389,11 @@ main(int argc, char *argv[]) (void) fclose(fp); num_lines = (int) (lptr - vec_lines); - (void) initscr(); /* initialize the curses library */ + if (ignore_sigs) { + InitAndCatch(initscr(), SIG_IGN); + } else { + initscr(); + } keypad(stdscr, TRUE); /* enable keyboard mapping */ (void) nonl(); /* tell curses not to do NL->CR/NL on output */ (void) cbreak(); /* take input chars one at a time, no wait for \n */ @@ -641,7 +646,7 @@ show_all(const char *tag) } #if defined(NCURSES_VERSION) || defined(HAVE_WCHGAT) if (try_color) - wchgat(stdscr, -1, A_NORMAL, my_pair, NULL); + wchgat(stdscr, -1, WA_NORMAL, my_pair, NULL); #endif } }