Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/usr.sbin/makemandb Don't parse Nm macro when it occurs anywh...



details:   https://anonhg.NetBSD.org/src/rev/900507ecf443
branches:  trunk
changeset: 353325:900507ecf443
user:      abhinav <abhinav%NetBSD.org@localhost>
date:      Sat Apr 29 14:43:09 2017 +0000

description:
Don't parse Nm macro when it occurs anywhere outside the NAME section.

mandoc(3) already generates the text node representing the value for the .Nm macro.
Doing our own parsing for .Nm on top of that leads to large duplication of text
in the database. This gets specially worse for man pages with large NAME sections,
such as queue(3).

diffstat:

 usr.sbin/makemandb/makemandb.c |  10 ++--------
 1 files changed, 2 insertions(+), 8 deletions(-)

diffs (31 lines):

diff -r 6e51c9d55165 -r 900507ecf443 usr.sbin/makemandb/makemandb.c
--- a/usr.sbin/makemandb/makemandb.c    Sat Apr 29 13:25:27 2017 +0000
+++ b/usr.sbin/makemandb/makemandb.c    Sat Apr 29 14:43:09 2017 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: makemandb.c,v 1.47 2017/04/20 13:11:35 joerg Exp $     */
+/*     $NetBSD: makemandb.c,v 1.48 2017/04/29 14:43:09 abhinav Exp $   */
 /*
  * Copyright (c) 2011 Abhinav Upadhyay <er.abhinav.upadhyay%gmail.com@localhost>
  * Copyright (c) 2011 Kristaps Dzonsons <kristaps%bsd.lv@localhost>
@@ -17,7 +17,7 @@
  */
 
 #include <sys/cdefs.h>
-__RCSID("$NetBSD: makemandb.c,v 1.47 2017/04/20 13:11:35 joerg Exp $");
+__RCSID("$NetBSD: makemandb.c,v 1.48 2017/04/29 14:43:09 abhinav Exp $");
 
 #include <sys/stat.h>
 #include <sys/types.h>
@@ -1120,12 +1120,6 @@
 
        if (n->type == ROFFT_TEXT) {
                mdoc_parse_section(n->sec, n->string, rec);
-       } else if (mdocs[n->tok] == pmdoc_Nm && rec->name != NULL) {
-               /*
-                * When encountering a .Nm macro, substitute it
-                * with its previously cached value of the argument.
-                */
-               mdoc_parse_section(n->sec, rec->name, rec);
        } else if (mdocs[n->tok] == pmdoc_Xr) {
                /*
                 * When encountering other inline macros,



Home | Main Index | Thread Index | Old Index