diff options
author | 2016-08-17 20:46:56 +0000 | |
---|---|---|
committer | 2016-08-17 20:46:56 +0000 | |
commit | cddabf4481def808a91c9b24836ff80880d10594 (patch) | |
tree | d88818c33a80dd1f73ed529d56f2d377b63cd2c5 /mandocdb.c | |
parent | 58f7533c9f4a757e9db71039330750a0b958f008 (diff) | |
download | mandoc-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.c | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -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); |