summaryrefslogtreecommitdiffstats
path: root/dba_read.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
commit82084a7d25acdbc823a8a52ae0e4b9fb266553f0 (patch)
treef449f366e7398e16fef98c86e353a1b16dec9b67 /dba_read.c
parenteccbe40515e1ca229e250d389f02e0395c281098 (diff)
downloadmandoc-82084a7d25acdbc823a8a52ae0e4b9fb266553f0.tar.gz
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 'dba_read.c')
-rw-r--r--dba_read.c7
1 files changed, 3 insertions, 4 deletions
diff --git a/dba_read.c b/dba_read.c
index 2825d061..0809eff9 100644
--- a/dba_read.c
+++ b/dba_read.c
@@ -48,12 +48,11 @@ dba_read(const char *fname)
dba = dba_new(npages < 128 ? 128 : npages);
for (ip = 0; ip < npages; ip++) {
pdata = dbm_page_get(ip);
- page = dba_page_new(dba->pages, NULL, pdata->sect,
- pdata->arch, pdata->desc, pdata->file + 1, *pdata->file);
+ page = dba_page_new(dba->pages, pdata->arch,
+ pdata->desc, pdata->file + 1, *pdata->file);
for (cp = pdata->name; *cp != '\0'; cp = strchr(cp, '\0') + 1)
dba_page_add(page, DBP_NAME, cp);
- cp = pdata->sect;
- while (*(cp = strchr(cp, '\0') + 1) != '\0')
+ for (cp = pdata->sect; *cp != '\0'; cp = strchr(cp, '\0') + 1)
dba_page_add(page, DBP_SECT, cp);
if ((cp = pdata->arch) != NULL)
while (*(cp = strchr(cp, '\0') + 1) != '\0')