#include <hashed_db.h>
#include <transform.h>
-MODULE_ID("$Id: tic.c,v 1.169 2012/04/14 21:34:26 tom Exp $")
+MODULE_ID("$Id: tic.c,v 1.170 2012/04/21 19:59:53 tom Exp $")
#define STDIN_NAME "<stdin>"
static bool capdump = FALSE; /* running as infotocap? */
static bool infodump = FALSE; /* running as captoinfo? */
static bool showsummary = FALSE;
+static char **namelst = 0;
static const char *to_remove;
static void (*save_check_termtype) (TERMTYPE *, bool);
#endif
static void
-cleanup(char **namelst GCC_UNUSED)
+cleanup(void)
{
#if NO_LEAKS
free_namelist(namelst);
failed(const char *msg)
{
perror(msg);
- cleanup((char **) 0);
ExitProgram(EXIT_FAILURE);
}
bool limited = TRUE;
char *tversion = (char *) NULL;
const char *source_file = "terminfo";
- char **namelst = 0;
char *outdir = (char *) NULL;
bool check_only = FALSE;
bool suppress_untranslatable = FALSE;
log_fp = stderr;
_nc_progname = _nc_rootname(argv[0]);
+ atexit(cleanup);
if ((infodump = same_program(_nc_progname, PROG_CAPTOINFO)) != FALSE) {
outform = F_TERMINFO;
break;
case 'V':
puts(curses_version());
- cleanup(namelst);
ExitProgram(EXIT_SUCCESS);
case 'c':
check_only = TRUE;
(void) fprintf(stderr,
"%s: Sorry, -e can't be used without -I or -C\n",
_nc_progname);
- cleanup(namelst);
ExitProgram(EXIT_FAILURE);
}
#endif /* HAVE_BIG_CORE */
_nc_progname,
_nc_progname,
usage_string);
- cleanup(namelst);
ExitProgram(EXIT_FAILURE);
}
}
/* do use resolution */
if (check_only || (!infodump && !capdump) || forceresolve) {
if (!_nc_resolve_uses2(TRUE, literal) && !check_only) {
- cleanup(namelst);
ExitProgram(EXIT_FAILURE);
}
}
else
fprintf(log_fp, "No entries written\n");
}
- cleanup(namelst);
ExitProgram(EXIT_SUCCESS);
}