* authorization. *
****************************************************************************/
/*
- * $Id: savescreen.c,v 1.21 2015/03/07 21:55:35 tom Exp $
+ * $Id: savescreen.c,v 1.23 2015/03/21 21:35:00 tom Exp $
*
* Demonstrate save/restore functions from the curses library.
* Thomas Dickey - 2007/7/14
#endif
static bool use_init = FALSE;
+static bool keep_dumps = FALSE;
static int
fexists(const char *name)
{
int n;
- for (n = 0; files[n] != 0; ++n) {
- unlink(files[n]);
+ if (!keep_dumps) {
+ for (n = 0; files[n] != 0; ++n) {
+ unlink(files[n]);
+ }
}
}
"",
"Options:",
" -i use scr_init/scr_restore rather than scr_set",
+ " -k keep the restored dump-files rather than removing them",
" -r replay the screen-dump files"
};
unsigned n;
bool done = FALSE;
char **files;
- while ((ch = getopt(argc, argv, "ir")) != -1) {
+ setlocale(LC_ALL, "");
+
+ while ((ch = getopt(argc, argv, "ikr")) != -1) {
switch (ch) {
case 'i':
use_init = TRUE;
break;
+ case 'k':
+ keep_dumps = TRUE;
+ break;
case 'r':
replaying = TRUE;
break;
*/
for (pair = 0; pair < COLOR_PAIRS; ++pair) {
color = (short) (pair % (COLORS - 1));
- init_pair(pair, COLOR_WHITE - color, color);
+ init_pair(pair, (short) (COLOR_WHITE - color), color);
}
}