diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2017-08-22 17:50:11 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2017-08-22 17:50:11 +0000 |
commit | 661f73aad9171f674528e78e7a02eead5dd6d693 (patch) | |
tree | 423bcfae11521dd4e9b5fe705535e5d58284cc73 /mansearch.c | |
parent | 82b23db3547fe38ffdbbddca8303b1ecc1dd4235 (diff) | |
download | mandoc-661f73aad9171f674528e78e7a02eead5dd6d693.tar.gz |
When finding a bogus database entry,
print a meaningful warning and skip the entry.
Issue reported by espie@.
Diffstat (limited to 'mansearch.c')
-rw-r--r-- | mansearch.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/mansearch.c b/mansearch.c index 44a4efa7..47285ba4 100644 --- a/mansearch.c +++ b/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; |