summaryrefslogtreecommitdiff
path: root/libexec
diff options
context:
space:
mode:
authortron <tron@NetBSD.org>2001-04-08 14:49:32 +0000
committertron <tron@NetBSD.org>2001-04-08 14:49:32 +0000
commit38499062023047df0c2f1e4efbda33c2b5111395 (patch)
tree563469f2117c8a9220298910c700b54eb48ee8ff /libexec
parentfd7e4484fcd4404817e010b9176db06a2f6afc95 (diff)
Abort parsing and invoke "nroff" if an unsupported macro is found in the
description section of an unformatted manual page. While this makes the "makewhatis" two times slower in avoids creation of several incorrect entries in the "whatis.db" database. This fixes PR bin/12535 by Thomas Klausner.
Diffstat (limited to 'libexec')
-rw-r--r--libexec/makewhatis/makewhatis.c8
1 files changed, 6 insertions, 2 deletions
diff --git a/libexec/makewhatis/makewhatis.c b/libexec/makewhatis/makewhatis.c
index 73cd56a8c08..056c33771f8 100644
--- a/libexec/makewhatis/makewhatis.c
+++ b/libexec/makewhatis/makewhatis.c
@@ -1,4 +1,4 @@
-/* $NetBSD: makewhatis.c,v 1.14 2001/04/08 14:27:50 tron Exp $ */
+/* $NetBSD: makewhatis.c,v 1.15 2001/04/08 14:49:32 tron Exp $ */
/*-
* Copyright (c) 1999 The NetBSD Foundation, Inc.
@@ -43,7 +43,7 @@ __COPYRIGHT("@(#) Copyright (c) 1999 The NetBSD Foundation, Inc.\n\
#endif /* not lint */
#ifndef lint
-__RCSID("$NetBSD: makewhatis.c,v 1.14 2001/04/08 14:27:50 tron Exp $");
+__RCSID("$NetBSD: makewhatis.c,v 1.15 2001/04/08 14:49:32 tron Exp $");
#endif /* not lint */
#include <sys/types.h>
@@ -688,6 +688,10 @@ parsemanpage(gzFile *in, int defaultsection)
if (*ptr == '.') {
char *space;
+ if (strncasecmp(ptr, ".Nd", 3) != 0) {
+ free(section);
+ return NULL;
+ }
space = findwhitespace(ptr);
if (space == NULL)
ptr = "";