aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2016-08-17 20:46:56 +0000
committerIngo Schwarze <schwarze@openbsd.org>2016-08-17 20:46:56 +0000
commitcddabf4481def808a91c9b24836ff80880d10594 (patch)
treed88818c33a80dd1f73ed529d56f2d377b63cd2c5 /mandocdb.c
parent58f7533c9f4a757e9db71039330750a0b958f008 (diff)
downloadmandoc-cddabf4481def808a91c9b24836ff80880d10594.tar.gz
mandoc-cddabf4481def808a91c9b24836ff80880d10594.tar.zst
mandoc-cddabf4481def808a91c9b24836ff80880d10594.zip
When the content of a manual page does not specify a section, the
empty string got added to the list of sections, breaking the database format slightly and causing the page to not be considered part of any section, not even if a section could be deduced from the directory or from the file name. Bug found due to the bogus pcredemo(3) "manual" in the pcre-8.38p0 package.
Diffstat (limited to 'mandocdb.c')
-rw-r--r--mandocdb.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 00773a58..f16652d5 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.226 2016/08/05 17:22:45 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.227 2016/08/17 20:46:56 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2016 Ingo Schwarze <schwarze@openbsd.org>
@@ -2013,11 +2013,12 @@ dbadd(struct dba *dba, struct mpage *mpage)
cp = mpage->desc;
i = strlen(cp);
mustfree = render_string(&cp, &i);
- mpage->dba = dba_page_new(dba->pages, mlink->name, mpage->sec,
+ mpage->dba = dba_page_new(dba->pages,
*mpage->arch == '\0' ? mlink->arch : mpage->arch,
cp, mlink->file, mpage->form);
if (mustfree)
free(cp);
+ dba_page_add(mpage->dba, DBP_SECT, mpage->sec);
while (mlink != NULL) {
dbadd_mlink(mlink);