From 550361815d6a1cf261e99ad2b430433ef6966e1a Mon Sep 17 00:00:00 2001 From: Max Rees Date: Fri, 5 Jun 2020 16:45:20 -0500 Subject: system/mandoc: new package --- system/mandoc/cgi-search.patch | 48 ++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 48 insertions(+) create mode 100644 system/mandoc/cgi-search.patch (limited to 'system/mandoc/cgi-search.patch') diff --git a/system/mandoc/cgi-search.patch b/system/mandoc/cgi-search.patch new file mode 100644 index 000000000..dd74be9ef --- /dev/null +++ b/system/mandoc/cgi-search.patch @@ -0,0 +1,48 @@ +Don't exit immediately if mansearch returns some paths that man.cgi +considers invalid, in particular translated manpages (e.g. +./de/man1/chfn.1). Just mark them as invalid (section 10, see struct +manpage in mansearch.h) and skip them later. + +--- mandoc-1.14.5/cgi.c 2019-03-10 04:56:43.000000000 -0500 ++++ mandoc-1.14.5/cgi.c 2020-06-05 15:54:05.681060852 -0500 +@@ -605,13 +602,20 @@ pg_searchres(const struct req *req, stru + size_t i, iuse; + int archprio, archpriouse; + int prio, priouse; ++ int results = 0; + + for (i = 0; i < sz; i++) { +- if (validate_filename(r[i].file)) ++ if (validate_filename(r[i].file)) { ++ results = 1; + continue; ++ } + warnx("invalid filename %s in %s database", + r[i].file, req->q.manpath); +- pg_error_internal(); ++ r[i].sec = 10; ++ } ++ ++ if (! results) { ++ pg_noresult(req, "No results found."); + return; + } + +@@ -642,6 +646,8 @@ pg_searchres(const struct req *req, stru + priouse = 20; + archpriouse = 3; + for (i = 0; i < sz; i++) { ++ if (r[i].sec == 10) ++ continue; + sec = r[i].file; + sec += strcspn(sec, "123456789"); + if (sec[0] == '\0') +@@ -681,6 +687,8 @@ pg_searchres(const struct req *req, stru + if (sz > 1) { + puts(""); + for (i = 0; i < sz; i++) { ++ if (r[i].sec == 10) ++ continue; + printf(" \n" + "
" + "