summaryrefslogtreecommitdiffstats
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2013-06-07 04:51:26 +0000
committerIngo Schwarze <schwarze@openbsd.org>2013-06-07 04:51:26 +0000
commita0a529d39a97dad050a7c7cfdc62365e6e04ce87 (patch)
treebc404f3330621a6beb7272013326f96d6c3a6d92 /mandocdb.c
parentabcea2e84eb36a5071348b5e3d32d407411200b5 (diff)
downloadmandoc-a0a529d39a97dad050a7c7cfdc62365e6e04ce87.tar.gz
In .Xr database entries, mention the manual section again;
the section was dropped when switching from db to sqlite. Use the customary format foo(N).
Diffstat (limited to 'mandocdb.c')
-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