summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man_validate.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-02-06 08:28:05 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-02-06 08:28:05 +0000
commit78c8cd1b4c93c31904483de44b50c4eee2cf0069 (patch)
treeb5a596a4ad1b3d05bf4b22434a408db9d851f776 /usr.bin/mandoc/man_validate.c
parentbe4ca90160180f092bf4c3ba13b390c55602f9b6 (diff)
better error reporting for .br .fi .nf with arguments
Diffstat (limited to 'usr.bin/mandoc/man_validate.c')
-rw-r--r--usr.bin/mandoc/man_validate.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/usr.bin/mandoc/man_validate.c b/usr.bin/mandoc/man_validate.c
index d16bdf2be69..965030d7c41 100644
--- a/usr.bin/mandoc/man_validate.c
+++ b/usr.bin/mandoc/man_validate.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_validate.c,v 1.81 2015/02/06 07:12:34 schwarze Exp $ */
+/* $OpenBSD: man_validate.c,v 1.82 2015/02/06 08:28:03 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012, 2013, 2014 Ingo Schwarze <schwarze@openbsd.org>
@@ -36,7 +36,6 @@
typedef void (*v_check)(CHKARGS);
-static void check_eq0(CHKARGS);
static void check_eq2(CHKARGS);
static void check_le1(CHKARGS);
static void check_le5(CHKARGS);
@@ -180,7 +179,6 @@ check_##name(CHKARGS) \
#ineq, (x), n->nchild); \
}
-INEQ_DEFINE(0, ==, eq0)
INEQ_DEFINE(2, ==, eq2)
INEQ_DEFINE(1, <=, le1)
INEQ_DEFINE(5, <=, le5)
@@ -399,9 +397,7 @@ static void
post_nf(CHKARGS)
{
- check_eq0(man, n);
-
- if (MAN_LITERAL & man->flags)
+ if (man->flags & MAN_LITERAL)
mandoc_msg(MANDOCERR_NF_SKIP, man->parse,
n->line, n->pos, "nf");
@@ -412,8 +408,6 @@ static void
post_fi(CHKARGS)
{
- check_eq0(man, n);
-
if ( ! (MAN_LITERAL & man->flags))
mandoc_msg(MANDOCERR_FI_SKIP, man->parse,
n->line, n->pos, "fi");
@@ -499,9 +493,7 @@ static void
post_vs(CHKARGS)
{
- if (n->tok == MAN_br)
- check_eq0(man, n);
- else
+ if (n->tok == MAN_sp)
check_le1(man, n);
if (NULL != n->prev)