aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-03-23 12:44:56 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-03-23 12:44:56 +0000
commit87fb027cd92fa277cc6404f10f66b97c9361e438 (patch)
tree1998b7dac7f20a03f4535852a1ff816b704a849b /mandocdb.c
parent9b38cbd9069ed0dc215f7029e03b3af63ee0f699 (diff)
downloadmandoc-87fb027cd92fa277cc6404f10f66b97c9361e438.tar.gz
mandoc-87fb027cd92fa277cc6404f10f66b97c9361e438.tar.zst
mandoc-87fb027cd92fa277cc6404f10f66b97c9361e438.zip
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.c30
1 files changed, 4 insertions, 26 deletions
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 <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -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