aboutsummaryrefslogtreecommitdiff
path: root/progs/toe.c
diff options
context:
space:
mode:
authorBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
committerBaptiste Daroussin <bapt@FreeBSD.org>2020-02-07 08:36:41 +0000
commitf0179cb6083cc92e5947ae56e6a0a5c5328aead0 (patch)
treebcee0ba9c2149b71f0bfc036df1e61e3105bf980 /progs/toe.c
parentcea297eb34d2361e79529034397465068ae34ecd (diff)
downloadsrc-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.tar.gz
src-f0179cb6083cc92e5947ae56e6a0a5c5328aead0.zip
Vendor import ncurses 6.1-20200118vendor/ncurses/6.1-20200118
Notes
Notes: svn path=/vendor/ncurses/dist/; revision=357645 svn path=/vendor/ncurses/6.1-20200118/; revision=357646; tag=vendor/ncurses/6.1-20200118
Diffstat (limited to 'progs/toe.c')
-rw-r--r--progs/toe.c38
1 files changed, 19 insertions, 19 deletions
diff --git a/progs/toe.c b/progs/toe.c
index 0d299b457dfb..7b9f79ad6d8d 100644
--- a/progs/toe.c
+++ b/progs/toe.c
@@ -1,5 +1,5 @@
/****************************************************************************
- * Copyright (c) 1998-2012,2013 Free Software Foundation, Inc. *
+ * Copyright (c) 1998-2017,2018 Free Software Foundation, Inc. *
* *
* Permission is hereby granted, free of charge, to any person obtaining a *
* copy of this software and associated documentation files (the *
@@ -44,7 +44,7 @@
#include <hashed_db.h>
#endif
-MODULE_ID("$Id: toe.c,v 1.74 2013/12/15 01:08:28 tom Exp $")
+MODULE_ID("$Id: toe.c,v 1.78 2018/11/17 22:41:46 tom Exp $")
#define isDotname(name) (!strcmp(name, ".") || !strcmp(name, ".."))
@@ -252,10 +252,10 @@ make_db_name(char *dst, const char *src, unsigned limit)
typedef void (DescHook) (int /* db_index */ ,
int /* db_limit */ ,
const char * /* term_name */ ,
- TERMTYPE * /* term */ );
+ TERMTYPE2 * /* term */ );
static const char *
-term_description(TERMTYPE *tp)
+term_description(TERMTYPE2 *tp)
{
const char *desc;
@@ -270,7 +270,7 @@ term_description(TERMTYPE *tp)
/* display a description for the type */
static void
-deschook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
+deschook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp)
{
(void) db_index;
(void) db_limit;
@@ -294,7 +294,7 @@ string_sum(const char *value)
}
static unsigned long
-checksum_of(TERMTYPE *tp)
+checksum_of(TERMTYPE2 *tp)
{
unsigned long result = string_sum(tp->term_names);
unsigned i;
@@ -313,7 +313,7 @@ checksum_of(TERMTYPE *tp)
/* collect data, to sort before display */
static void
-sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
+sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE2 *tp)
{
TERMDATA *data = new_termdata();
@@ -327,7 +327,7 @@ sorthook(int db_index, int db_limit, const char *term_name, TERMTYPE *tp)
static void
show_termcap(int db_index, int db_limit, char *buffer, DescHook hook)
{
- TERMTYPE data;
+ TERMTYPE2 data;
char *next = strchr(buffer, ':');
char *last;
char *list = buffer;
@@ -424,7 +424,7 @@ typelist(int eargc, char *eargv[],
}
while ((entry = readdir(entrydir)) != 0) {
char *name_2;
- TERMTYPE lterm;
+ TERMTYPE2 lterm;
char *cn;
int status;
@@ -440,11 +440,8 @@ typelist(int eargc, char *eargv[],
(void) fprintf(stderr,
"%s: couldn't open terminfo file %s.\n",
_nc_progname, name_2);
- free(cwd_buf);
free(name_2);
- closedir(entrydir);
- closedir(termdir);
- return (EXIT_FAILURE);
+ continue;
}
/* only visit things once, by primary name */
@@ -453,7 +450,7 @@ typelist(int eargc, char *eargv[],
/* apply the selected hook function */
hook(i, eargc, cn, &lterm);
}
- _nc_free_termtype(&lterm);
+ _nc_free_termtype2(&lterm);
free(name_2);
}
closedir(entrydir);
@@ -478,7 +475,7 @@ typelist(int eargc, char *eargv[],
code = _nc_db_first(capdbp, &key, &data);
while (code == 0) {
- TERMTYPE lterm;
+ TERMTYPE2 lterm;
int used;
char *have;
char *cn;
@@ -489,7 +486,7 @@ typelist(int eargc, char *eargv[],
cn = _nc_first_name(lterm.term_names);
/* apply the selected hook function */
hook(i, eargc, cn, &lterm);
- _nc_free_termtype(&lterm);
+ _nc_free_termtype2(&lterm);
}
}
code = _nc_db_next(capdbp, &key, &data);
@@ -500,8 +497,8 @@ typelist(int eargc, char *eargv[],
}
}
}
-#endif
-#endif
+#endif /* USE_HASHED_DB */
+#endif /* NCURSES_USE_DATABASE */
#if NCURSES_USE_TERMCAP
#if HAVE_BSD_CGETENT
{
@@ -703,6 +700,8 @@ main(int argc, char *argv[])
_nc_first_db(&state, &offset);
while ((path = _nc_next_db(&state, &offset)) != 0) {
+ if (quick_prefix(path))
+ continue;
if (pass) {
eargv[count] = strmalloc(path);
}
@@ -728,7 +727,8 @@ main(int argc, char *argv[])
failed("eargv");
_nc_first_db(&state, &offset);
if ((path = _nc_next_db(&state, &offset)) != 0) {
- eargv[count++] = strmalloc(path);
+ if (!quick_prefix(path))
+ eargv[count++] = strmalloc(path);
}
code = typelist((int) count, eargv, header, hook);