From 87fb027cd92fa277cc6404f10f66b97c9361e438 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sun, 23 Mar 2014 12:44:56 +0000 Subject: If an .Nd block contains macros, avoid fragmented entries in mandocdb(8), instead use the .Nd content recursively. --- mandocdb.c | 30 ++++-------------------------- 1 file changed, 4 insertions(+), 26 deletions(-) (limited to 'mandocdb.c') diff --git a/mandocdb.c b/mandocdb.c index 535f0e36..b919036e 100644 --- a/mandocdb.c +++ b/mandocdb.c @@ -1,4 +1,4 @@ -/* $Id: mandocdb.c,v 1.121 2014/03/23 12:26:58 schwarze Exp $ */ +/* $Id: mandocdb.c,v 1.122 2014/03/23 12:44:56 schwarze Exp $ */ /* * Copyright (c) 2011, 2012 Kristaps Dzonsons * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -1506,32 +1506,10 @@ parse_mdoc_Xr(struct mpage *mpage, const struct mdoc_node *n) static int parse_mdoc_Nd(struct mpage *mpage, const struct mdoc_node *n) { - size_t sz; - - if (MDOC_BODY != n->type) - return(0); - /* - * Special-case the `Nd' because we need to put the description - * into the document table. - */ - - for (n = n->child; NULL != n; n = n->next) { - if (MDOC_TEXT == n->type) { - if (NULL != mpage->desc) { - sz = strlen(mpage->desc) + - strlen(n->string) + 2; - mpage->desc = mandoc_realloc( - mpage->desc, sz); - strlcat(mpage->desc, " ", sz); - strlcat(mpage->desc, n->string, sz); - } else - mpage->desc = mandoc_strdup(n->string); - } - if (NULL != n->child) - parse_mdoc_Nd(mpage, n); - } - return(1); + if (MDOC_BODY == n->type) + mdoc_deroff(&mpage->desc, n); + return(0); } static int -- cgit v1.2.3-56-ge451