From cddabf4481def808a91c9b24836ff80880d10594 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Wed, 17 Aug 2016 20:46:56 +0000 Subject: 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. --- dba.c | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) (limited to 'dba.c') 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 * @@ -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); -- cgit v1.2.3-56-ge451