aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mandocdb.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-04-04 15:55:19 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-04-04 15:55:19 +0000
commit994580065e7e64895b2192324b068e553d90f7ba (patch)
tree18c50b1047cc520798ef613f5705169253c25421 /mandocdb.c
parent7fb2fd7f16e762237be097523fb48320a165689e (diff)
downloadmandoc-994580065e7e64895b2192324b068e553d90f7ba.tar.gz
mandoc-994580065e7e64895b2192324b068e553d90f7ba.tar.zst
mandoc-994580065e7e64895b2192324b068e553d90f7ba.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 'mandocdb.c')
-rw-r--r--mandocdb.c15
1 files changed, 9 insertions, 6 deletions
diff --git a/mandocdb.c b/mandocdb.c
index a054ffc9..40f673fe 100644
--- a/mandocdb.c
+++ b/mandocdb.c
@@ -1,4 +1,4 @@
-/* $Id: mandocdb.c,v 1.128 2014/04/04 02:31:07 schwarze Exp $ */
+/* $Id: mandocdb.c,v 1.129 2014/04/04 15:55:19 schwarze Exp $ */
/*
* Copyright (c) 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -224,7 +224,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 */
@@ -1397,7 +1397,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;
@@ -1411,7 +1411,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;
}
@@ -1588,8 +1588,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