Source-Changes-HG archive

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

[src/trunk]: src/libexec/makewhatis PR/47958: Robert Kovacic: makewhatis.c no...



details:   https://anonhg.NetBSD.org/src/rev/e1bf9770e1fa
branches:  trunk
changeset: 787567:e1bf9770e1fa
user:      christos <christos%NetBSD.org@localhost>
date:      Mon Jun 24 12:56:22 2013 +0000

description:
PR/47958: Robert Kovacic: makewhatis.c not generating entries in whatisdb
for POD generated pages

diffstat:

 libexec/makewhatis/makewhatis.c |  24 ++++++++++++++++++++++--
 1 files changed, 22 insertions(+), 2 deletions(-)

diffs (52 lines):

diff -r dea9ea521f7c -r e1bf9770e1fa libexec/makewhatis/makewhatis.c
--- a/libexec/makewhatis/makewhatis.c   Mon Jun 24 11:32:21 2013 +0000
+++ b/libexec/makewhatis/makewhatis.c   Mon Jun 24 12:56:22 2013 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: makewhatis.c,v 1.47 2009/04/02 21:39:33 apb Exp $      */
+/*     $NetBSD: makewhatis.c,v 1.48 2013/06/24 12:56:22 christos Exp $ */
 
 /*-
  * Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -37,7 +37,7 @@
 #if !defined(lint)
 __COPYRIGHT("@(#) Copyright (c) 1999\
  The NetBSD Foundation, Inc.  All rights reserved.");
-__RCSID("$NetBSD: makewhatis.c,v 1.47 2009/04/02 21:39:33 apb Exp $");
+__RCSID("$NetBSD: makewhatis.c,v 1.48 2013/06/24 12:56:22 christos Exp $");
 #endif /* not lint */
 
 #include <sys/types.h>
@@ -871,6 +871,8 @@
 parsemanpage(const char *name, gzFile *in, int defaultsection)
 {
        char    *section, buffer[8192], *ptr;
+       static const char POD[] = ".\\\" Automatically generated by Pod";
+       static const char IX[] = ".IX TITLE";
 
        section = NULL;
        do {
@@ -878,6 +880,24 @@
                        free(section);
                        return NULL;
                }
+
+               /*
+                * Skip over lines in man pages that have been generated
+                * by Pod, until we find the TITLE. This makewhatis cannot
+                * deal with it (and as * a result the man page would not
+                * appear in whatis.db)
+                * Modified by Robert Kovacic, June 23 2013.
+                */
+               if (strncasecmp(buffer, POD, sizeof(POD) - 1) == 0) {
+                       do {
+                               if (GetS(in, buffer, sizeof(buffer) - 1)
+                                   == NULL) {
+                                       free(section);
+                                       return NULL;
+                               }
+                       } while (strncasecmp(buffer, IX, sizeof(IX) - 1) != 0);
+               } 
+
                if (manpreprocess(buffer))
                        continue;
                if (strncasecmp(buffer, ".Dt", 3) == 0) {



Home | Main Index | Thread Index | Old Index