From 9f11efb0307eb4c4dbb4a8fff243321100e27573 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Wed, 12 May 2010 08:41:17 +0000 Subject: mdoc_atosec -> mdoc_str2sec (consistent with str2 being different from a2). Changed ordering of sections (EXIT STATUS moved around), argued for by Ulrich Sporlein. Fixed mdoc_str2sec not to use weird structure. --- mdoc_validate.c | 13 ++++++++----- 1 file changed, 8 insertions(+), 5 deletions(-) (limited to 'mdoc_validate.c') diff --git a/mdoc_validate.c b/mdoc_validate.c index a25ae856..85d78e1e 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.71 2010/05/09 21:19:42 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.72 2010/05/12 08:41:17 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -1286,21 +1286,24 @@ post_sh_head(POST_ARGS) return(mdoc_nerr(mdoc, n, ETOOLONG)); } - sec = mdoc_atosec(buf); + sec = mdoc_str2sec(buf); /* * Check: NAME should always be first, CUSTOM has no roles, * non-CUSTOM has a conventional order to be followed. */ - if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed && - ! mdoc_nwarn(mdoc, mdoc->last, ESECNAME)) - return(0); + if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed) + if ( ! mdoc_nwarn(mdoc, mdoc->last, ESECNAME)) + return(0); + if (SEC_CUSTOM == sec) return(1); + if (sec == mdoc->lastnamed) if ( ! mdoc_nwarn(mdoc, mdoc->last, ESECREP)) return(0); + if (sec < mdoc->lastnamed) if ( ! mdoc_nwarn(mdoc, mdoc->last, ESECOOO)) return(0); -- cgit v1.2.3