From 04c844c9b370f59b5c07157eec6ba5a879b30218 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 31 Dec 2018 04:55:46 +0000 Subject: 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. --- read.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'read.c') diff --git a/read.c b/read.c index 8ab3c803..afafcdb5 100644 --- a/read.c +++ b/read.c @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.209 2018/12/30 00:49:55 schwarze Exp $ */ +/* $Id: read.c,v 1.210 2018/12/31 04:55:47 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2018 Ingo Schwarze @@ -688,6 +688,7 @@ mparse_free(struct mparse *curp) struct roff_meta * mparse_result(struct mparse *curp) { + roff_state_reset(curp->man); if (curp->options & MPARSE_VALIDATE) { if (curp->man->meta.macroset == MACROSET_MDOC) mdoc_validate(curp->man); -- cgit v1.2.3-56-ge451