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.
This commit is contained in:
tron 2001-04-08 14:49:32 +00:00
parent fd7e4484fc
commit 3849906202

View File

@ -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 = "";