diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2014-04-04 15:55:19 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2014-04-04 15:55:19 +0000 |
commit | 612feaffd17f2c4aa1145f4d956d80bfcc44ee7b (patch) | |
tree | 7f9f6f78204893171dfbfcc56a8d8d1a4c435136 /mandocdb.c | |
parent | 770ad91865b8eb1c1ecb431ebe1a2bbb1bb7268d (diff) | |
download | mandoc-612feaffd17f2c4aa1145f4d956d80bfcc44ee7b.tar.gz |
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.c | 13 |
1 files changed, 8 insertions, 5 deletions
@@ -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 |