From 994580065e7e64895b2192324b068e553d90f7ba Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Fri, 4 Apr 2014 15:55:19 +0000 Subject: 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. --- mandocdb.c | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) (limited to 'mandocdb.c') 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 * Copyright (c) 2011, 2012, 2013, 2014 Ingo Schwarze @@ -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 -- cgit v1.2.3-56-ge451