summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/mandocdb.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2014-04-04 15:55:17 +0000
committerschwarze <schwarze@openbsd.org>2014-04-04 15:55:17 +0000
commita5ccd03a54b986d491ce35e12ef80e1b36f95765 (patch)
treedbb9bc8e31a2d4ad55cd255b68843005f62acb9e /usr.bin/mandoc/mandocdb.c
parentstart the purge task after events are set, or we can miss SIGCHLD (diff)
downloadwireguard-openbsd-a5ccd03a54b986d491ce35e12ef80e1b36f95765.tar.xz
wireguard-openbsd-a5ccd03a54b986d491ce35e12ef80e1b36f95765.zip
Remember which names are in the NAME section.
This helps to find missing MLINKS. Database build times do not change and database growth is minimal (1.2% with -Q, 0.7% without -Q in /usr/share/man), so making this optional would be pointless.
Diffstat (limited to 'usr.bin/mandoc/mandocdb.c')
-rw-r--r--usr.bin/mandoc/mandocdb.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/usr.bin/mandoc/mandocdb.c b/usr.bin/mandoc/mandocdb.c
index ced3c83771d..4c72000b23d 100644
--- a/usr.bin/mandoc/mandocdb.c
+++ b/usr.bin/mandoc/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.85 2014/04/04 02:31:01 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.86 2014/04/04 15:55:17 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -216,7 +216,7 @@ static const struct mdoc_handler mdocs[MDOC_MAX] = {
{ NULL, TYPE_In }, /* In */
{ NULL, TYPE_Li }, /* Li */
{ parse_mdoc_Nd, TYPE_Nd }, /* Nd */
- { parse_mdoc_Nm, TYPE_Nm }, /* Nm */
+ { parse_mdoc_Nm, 0 }, /* Nm */
{ NULL, 0 }, /* Op */
{ NULL, 0 }, /* Ot */
{ NULL, TYPE_Pa }, /* Pa */
@@ -1389,7 +1389,7 @@ parse_man(struct mpage *mpage, const struct man_node *n)
('\\' == start[0] && '-' == start[1]))
break;
- putkey(mpage, start, TYPE_Nm);
+ putkey(mpage, start, TYPE_NAME | TYPE_Nm);
if (' ' == byte) {
start += sz + 1;
@@ -1403,7 +1403,7 @@ parse_man(struct mpage *mpage, const struct man_node *n)
}
if (start == title) {
- putkey(mpage, start, TYPE_Nm);
+ putkey(mpage, start, TYPE_NAME | TYPE_Nm);
free(title);
return;
}
@@ -1580,8 +1580,11 @@ static int
parse_mdoc_Nm(struct mpage *mpage, const struct mdoc_node *n)
{
- return(SEC_NAME == n->sec ||
- (SEC_SYNOPSIS == n->sec && MDOC_HEAD == n->type));
+ if (SEC_NAME == n->sec)
+ putmdockey(mpage, n->child, TYPE_NAME | TYPE_Nm);
+ else if (SEC_SYNOPSIS == n->sec && MDOC_HEAD == n->type)
+ putmdockey(mpage, n->child, TYPE_Nm);
+ return(0);
}
static int