diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-31 04:55:43 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2018-12-31 04:55:43 +0000 |
commit | 9dc0cbc9432027eab2d3c04c14013690b258818c (patch) | |
tree | 4c751989e920d43325566c37f6a4292d7ecd0f26 /usr.bin/mandoc/mdoc_validate.c | |
parent | 9eca19b985d2c8f9ff720551709ddebb3287cfba (diff) |
Cleanup, minus 15 LOC, no functional change:
Simplify the way the man(7) and mdoc(7) validators are called.
Reset the parser state with a common function before calling them.
There is no need to again reset the parser state afterwards,
the parsers are no longer used after validation.
This allows getting rid of man_node_validate() and mdoc_node_validate()
as separate functions.
Diffstat (limited to 'usr.bin/mandoc/mdoc_validate.c')
-rw-r--r-- | usr.bin/mandoc/mdoc_validate.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/usr.bin/mandoc/mdoc_validate.c b/usr.bin/mandoc/mdoc_validate.c index 8a76a27f74b..8ac38a2a6a8 100644 --- a/usr.bin/mandoc/mdoc_validate.c +++ b/usr.bin/mandoc/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $OpenBSD: mdoc_validate.c,v 1.281 2018/12/30 00:48:48 schwarze Exp $ */ +/* $OpenBSD: mdoc_validate.c,v 1.282 2018/12/31 04:55:42 schwarze Exp $ */ /* * Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2018 Ingo Schwarze <schwarze@openbsd.org> @@ -286,7 +286,7 @@ static const char * const secnames[SEC__MAX] = { /* Validate the subtree rooted at mdoc->last. */ void -mdoc_node_validate(struct roff_man *mdoc) +mdoc_validate(struct roff_man *mdoc) { struct roff_node *n, *np; const v_post *p; @@ -317,7 +317,7 @@ mdoc_node_validate(struct roff_man *mdoc) mdoc->last = mdoc->last->child; while (mdoc->last != NULL) { - mdoc_node_validate(mdoc); + mdoc_validate(mdoc); if (mdoc->last == n) mdoc->last = mdoc->last->child; else |