summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-01-27 00:56:32 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-01-27 00:56:32 +0000
commitd82b8844224205bec613a0e8017033b2b8f7058f (patch)
tree707cb09963fca66b3640c69cbb28f578adba1931 /mandocdb.c
parent9c1812210ecec346a155064fef8ad4063179dc08 (diff)
downloadmandoc-d82b8844224205bec613a0e8017033b2b8f7058f.tar.gz
Always register names taken from file names in the names ohash.
Bug found by makewhatis -p crashing in mlink_check().
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c10
1 files changed, 6 insertions, 4 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 39b692ae..ad7292a3 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1216,13 +1216,15 @@ mpages_merge(struct dba *dba, struct mparse *mp)
if (mpage->desc == NULL)
mpage->desc = mandoc_strdup(mpage->mlinks->name);
- if (warnings && !use_all)
- for (mlink = mpage->mlinks; mlink;
- mlink = mlink->next)
+ for (mlink = mpage->mlinks;
+ mlink != NULL;
+ mlink = mlink->next) {
+ putkey(mpage, mlink->name, NAME_FILE);
+ if (warnings && !use_all)
mlink_check(mpage, mlink);
+ }
dbadd(dba, mpage);
- mlink = mpage->mlinks;
nextpage:
ohash_delete(&strings);