On 2017-07-14 16:13 +0200, Sven Joachim wrote:

> Package: libtinfo5
> Version: 6.0+20170701-1
> Severity: serious
>
> The symbol _nc_read_entry got inadvertently dropped in favor of
> _nc_read_entry2, and this breaks reverse dependencies (ncurses-bin
> before 6.0+20170701-1 and tack):

This happened because _nc_read_entry is only compiled in if
NCURSES_EXT_NUMBERS is #defined and not 0.  There's probably a good reason
for this, since when I take out this condition infocmp from stretch
segfaults.

Bringing back the previous implementation of _nc_read_entry instead
seems to work, as in the attached patch.  While this might to be good
enough for Debian, upstream likely want a better solution that works
with other configure flags as well.

Sven

---
 ncurses/tinfo/read_entry.c |   40 ++++++++++++++++++++++++++++++++++++++++
 1 file changed, 40 insertions(+)

--- a/ncurses/tinfo/read_entry.c
+++ b/ncurses/tinfo/read_entry.c
@@ -766,4 +766,44 @@ _nc_read_entry(const char *const name, c
 	_nc_export_termtype2(tp, &dummy);
     return rc;
 }
+#else
+NCURSES_EXPORT(int)
+_nc_read_entry(const char *const name, char *const filename, TERMTYPE *const tp)
+{
+    int code = TGETENT_NO;
+
+    _nc_SPRINTF(filename, _nc_SLIMIT(PATH_MAX)
+		"%.*s", PATH_MAX - 1, name);
+
+    if (strlen(name) == 0
+	|| strcmp(name, ".") == 0
+	|| strcmp(name, "..") == 0
+	|| _nc_pathlast(name) != 0
+	|| strchr(name, NCURSES_PATHSEP) != 0) {
+	TR(TRACE_DATABASE, ("illegal or missing entry name '%s'", name));
+    } else {
+#if NCURSES_USE_DATABASE
+	DBDIRS state;
+	int offset;
+	const char *path;
+
+	_nc_first_db(&state, &offset);
+	code = TGETENT_ERR;
+	while ((path = _nc_next_db(&state, &offset)) != 0) {
+	    code = _nc_read_tic_entry(filename, PATH_MAX, path, name, tp);
+	    if (code == TGETENT_YES) {
+		_nc_last_db();
+		break;
+	    }
+	}
+#elif NCURSES_USE_TERMCAP
+	if (code != TGETENT_YES) {
+	    code = _nc_read_termcap_entry(name, tp);
+	    _nc_SPRINTF(filename, _nc_SLIMIT(PATH_MAX)
+			"%.*s", PATH_MAX - 1, _nc_get_source());
+	}
+#endif
+    }
+    return code;
+}
 #endif

Reply via email to