]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/ncurses.c
ncurses 5.7 - patch 20090803
[ncurses.git] / test / ncurses.c
index c1f700cac8e59d4aef25483a5a72941ea6301bc7..70b0d86af28395b382730b42b89d7cd9fb146571 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.338 2009/03/28 21:40:51 tom Exp $
+$Id: ncurses.c,v 1.343 2009/07/30 09:13:37 tom Exp $
 
 ***************************************************************************/
 
@@ -318,6 +318,7 @@ make_narrow_text(wchar_t *target, const char *source)
     *target = 0;
 }
 
+#if USE_LIBPANEL
 static void
 make_fullwidth_digit(cchar_t *target, int digit)
 {
@@ -327,6 +328,7 @@ make_fullwidth_digit(cchar_t *target, int digit)
     source[1] = 0;
     setcchar(target, source, A_NORMAL, 0, 0);
 }
+#endif
 
 static int
 wGet_wchar(WINDOW *win, wint_t *result)
@@ -483,7 +485,11 @@ ShellOut(bool message)
        addstr("Shelling out...");
     def_prog_mode();
     endwin();
+#ifdef __MINGW32__
+    system("cmd.exe");
+#else
     system("sh");
+#endif
     if (message)
        addstr("returned from shellout.\n");
     refresh();
@@ -670,7 +676,7 @@ remember_boxes(unsigned level, WINDOW *txt_win, WINDOW *box_win)
 {
     unsigned need = (level + 1) * 2;
 
-    assert(level < COLS);
+    assert(level < (unsigned) COLS);
 
     if (winstack == 0) {
        len_winstack = 20;
@@ -924,6 +930,7 @@ getch_test(void)
     wgetch_test(0, stdscr, delay);
     forget_boxes();
     finish_getch_test();
+    slk_clear();
 }
 
 #if USE_WIDEC_SUPPORT
@@ -1141,6 +1148,7 @@ get_wch_test(void)
     wget_wch_test(0, stdscr, delay);
     forget_boxes();
     finish_getch_test();
+    slk_clear();
 }
 #endif
 
@@ -2882,7 +2890,7 @@ cycle_attr(int ch, unsigned *at_code, chtype *attr)
            *at_code = 0;
        break;
     case 'V':
-       if (*at_code == 1)
+       if (*at_code == 0)
            *at_code = SIZEOF(attrs_to_cycle) - 1;
        else
            *at_code -= 1;
@@ -3233,21 +3241,18 @@ acs_display(void)
 static cchar_t *
 merge_wide_attr(cchar_t *dst, const cchar_t *src, attr_t attr, short pair)
 {
-    int count = getcchar(src, NULL, NULL, NULL, 0);
-    wchar_t *wch = 0;
-    attr_t ignore_attr;
-    short ignore_pair;
+    int count;
 
     *dst = *src;
-    if (count > 0) {
-       if ((wch = typeMalloc(wchar_t, (unsigned) count + 1)) != 0) {
-           if (getcchar(src, wch, &ignore_attr, &ignore_pair, 0) != ERR) {
-               attr |= (ignore_attr & A_ALTCHARSET);
-               setcchar(dst, wch, attr, pair, 0);
-           }
-           free(wch);
+    do {
+       TEST_CCHAR(src, count, {
+           attr |= (test_attrs & A_ALTCHARSET);
+           setcchar(dst, test_wch, attr, pair, NULL);
        }
-    }
+       , {
+           ;
+       });
+    } while (0);
     return dst;
 }