summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--mandocdb.c15
1 files changed, 13 insertions, 2 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 32c90922..7738604e 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1446,12 +1446,23 @@ parse_mdoc_St(struct of *of, const struct mdoc_node *n)
static int
parse_mdoc_Xr(struct of *of, const struct mdoc_node *n)
{
+ char *cp;
if (NULL == (n = n->child))
return(0);
- putkey(of, n->string, TYPE_Xr);
- return(1);
+ if (NULL == n->next) {
+ putkey(of, n->string, TYPE_Xr);
+ return(0);
+ }
+
+ if (-1 == asprintf(&cp, "%s(%s)", n->string, n->next->string)) {
+ perror(NULL);
+ exit((int)MANDOCLEVEL_SYSERR);
+ }
+ putkey(of, cp, TYPE_Xr);
+ free(cp);
+ return(0);
}
static int