aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/dba.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 /dba.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 'dba.c')
-rw-r--r--dba.c9
1 files changed, 3 insertions, 6 deletions
diff --git a/dba.c b/dba.c
index b414c436..1f2d21c4 100644
--- a/dba.c
+++ b/dba.c
@@ -1,4 +1,4 @@
-/* $Id: dba.c,v 1.7 2016/08/17 18:59:37 schwarze Exp $ */
+/* $Id: dba.c,v 1.8 2016/08/17 20:46:56 schwarze Exp $ */
/*
* Copyright (c) 2016 Ingo Schwarze <schwarze@openbsd.org>
*
@@ -136,18 +136,15 @@ dba_write(const char *fname, struct dba *dba)
* Create a new page and append it to the pages table.
*/
struct dba_array *
-dba_page_new(struct dba_array *pages, const char *name, const char *sect,
- const char *arch, const char *desc, const char *file, enum form form)
+dba_page_new(struct dba_array *pages, const char *arch,
+ const char *desc, const char *file, enum form form)
{
struct dba_array *page, *entry;
page = dba_array_new(DBP_MAX, 0);
entry = dba_array_new(1, DBA_STR | DBA_GROW);
- if (name != NULL)
- dba_array_add(entry, prepend(name, NAME_FILE & NAME_MASK));
dba_array_add(page, entry);
entry = dba_array_new(1, DBA_STR | DBA_GROW);
- dba_array_add(entry, (void *)sect);
dba_array_add(page, entry);
if (arch != NULL && *arch != '\0') {
entry = dba_array_new(1, DBA_STR | DBA_GROW);