aboutsummaryrefslogtreecommitdiffstatshomepage
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
commitfd57481c1d70db75f8850ef82e5f1f4131c26173 (patch)
tree9736c0e160e37b9c1c8af409d4581a181596615c /mandocdb.c
parente5bff5e430c392e3c6a319145c5d7887c8b72c8e (diff)
downloadmandoc-fd57481c1d70db75f8850ef82e5f1f4131c26173.tar.gz
mandoc-fd57481c1d70db75f8850ef82e5f1f4131c26173.tar.zst
mandoc-fd57481c1d70db75f8850ef82e5f1f4131c26173.zip
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.c17
1 files changed, 14 insertions, 3 deletions
diff --git a/mandocdb.c b/mandocdb.c
index 513f8e85..b55d5645 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.66 2013/06/07 01:01:34 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.67 2013/06/07 04:51:26 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org>
@@ -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