diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-23 12:44:56 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-03-23 12:44:56 +0000 |
commit | 527d07ef48406d7e7b0e3f84aab2251ff33a4599 (patch) | |
tree | f4a45e7bd3dcaf382d63a61ac12fb852ca40b00e /mandocdb.c | |
parent | 85c9ebb82f6cfd81fa04de4344ca2948d174c95c (diff) | |
download | mandoc-527d07ef48406d7e7b0e3f84aab2251ff33a4599.tar.gz |
If an .Nd block contains macros, avoid fragmented entries in mandocdb(8),
instead use the .Nd content recursively.
Diffstat (limited to 'mandocdb.c')
-rw-r--r-- | mandocdb.c | 28 |
1 files changed, 3 insertions, 25 deletions
@@ -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 |