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. --- man_validate.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'man_validate.c') diff --git a/man_validate.c b/man_validate.c index cfe6bc8b..b6262599 100644 --- a/man_validate.c +++ b/man_validate.c @@ -1,4 +1,4 @@ -/* $Id: man_validate.c,v 1.142 2018/12/16 00:21:05 schwarze Exp $ */ +/* $Id: man_validate.c,v 1.143 2018/12/31 04:55:46 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010, 2012-2018 Ingo Schwarze @@ -101,7 +101,7 @@ static const v_check man_valids[MAN_MAX - MAN_TH] = { /* Validate the subtree rooted at man->last. */ void -man_node_validate(struct roff_man *man) +man_validate(struct roff_man *man) { struct roff_node *n; const v_check *cp; @@ -128,7 +128,7 @@ man_node_validate(struct roff_man *man) man->last = man->last->child; while (man->last != NULL) { - man_node_validate(man); + man_validate(man); if (man->last == n) man->last = man->last->child; else -- cgit v1.2.3-56-ge451