]> ncurses.scripts.mit.edu Git - ncurses.git/blobdiff - test/dots_xcurses.c
ncurses 6.3 - patch 20221112
[ncurses.git] / test / dots_xcurses.c
index a2aa8b92661b6a82efd2267c4267fda39f9bd4a1..3ccdea37a06456cb48bed467b172b25e62f97d17 100644 (file)
@@ -1,5 +1,5 @@
 /****************************************************************************
- * Copyright 2018-2019,2020 Thomas E. Dickey                                *
+ * Copyright 2018-2020,2022 Thomas E. Dickey                                *
  * Copyright 2017 Free Software Foundation, Inc.                            *
  *                                                                          *
  * Permission is hereby granted, free of charge, to any person obtaining a  *
 /*
  * Author: Thomas E. Dickey
  *
- * $Id: dots_xcurses.c,v 1.22 2020/05/10 00:32:33 tom Exp $
+ * $Id: dots_xcurses.c,v 1.25 2022/04/16 18:27:24 tom Exp $
  *
  * A simple demo of the wide-curses interface used for comparison with termcap.
  */
 #include <test.priv.h>
 
-#if !defined(_WIN32)
+#if !defined(_NC_WINDOWS)
 #include <sys/time.h>
 #endif
 
@@ -193,6 +193,7 @@ main(int argc, char *argv[])
        }
     }
 
+    setlocale(LC_ALL, "");
     srand((unsigned) time(0));
 
     SetupAlarm(r_option);
@@ -244,7 +245,8 @@ main(int argc, char *argv[])
                set_colors(fg = z, bg);
            } else {
                set_colors(fg, bg = z);
-               napms(s_option);
+               if (s_option)
+                   napms(s_option);
            }
        } else {
            if (ranf() <= 0.01) {
@@ -253,7 +255,8 @@ main(int argc, char *argv[])
                } else {
                    attr_off(WA_REVERSE, NULL);
                }
-               napms(s_option);
+               if (s_option)
+                   napms(s_option);
            }
        }
        wch[0] = (wchar_t) p;