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. --- mandocdb.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'mandocdb.c') 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 * Copyright (c) 2011-2016 Ingo Schwarze @@ -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); -- cgit v1.2.3-56-ge451