* mandoc: When finding a bogus database entry, print a meaningful warning
@ 2017-08-22 17:50 schwarze
0 siblings, 0 replies; only message in thread
From: schwarze @ 2017-08-22 17:50 UTC (permalink / raw)
To: source
Log Message:
-----------
When finding a bogus database entry,
print a meaningful warning and skip the entry.
Issue reported by espie@.
Modified Files:
--------------
mandoc:
mansearch.c
Revision Data
-------------
Index: mansearch.c
===================================================================
RCS file: /home/cvs/mandoc/mandoc/mansearch.c,v
retrieving revision 1.76
retrieving revision 1.77
diff -Lmansearch.c -Lmansearch.c -u -p -r1.76 -r1.77
--- mansearch.c
+++ mansearch.c
@@ -188,6 +188,16 @@ mansearch(const struct mansearch *search
mpage = *res + cur;
mandoc_asprintf(&mpage->file, "%s/%s",
paths->paths[i], page->file + 1);
+ if (access(chdir_status ? page->file + 1 :
+ mpage->file, R_OK) == -1) {
+ warn("%s", mpage->file);
+ warnx("outdated mandoc.db contains "
+ "bogus %s entry, run makewhatis %s",
+ page->file + 1, paths->paths[i]);
+ free(mpage->file);
+ free(rp);
+ continue;
+ }
mpage->names = buildnames(page);
mpage->output = buildoutput(outkey, page);
mpage->ipath = i;
--
To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2017-08-22 17:50 UTC | newest]
Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-08-22 17:50 mandoc: When finding a bogus database entry, print a meaningful warning schwarze
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).