aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-12 08:41:17 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-12 08:41:17 +0000
commit9f11efb0307eb4c4dbb4a8fff243321100e27573 (patch)
tree1eec3760c1790106496b536cde695f4912d0278e /mdoc_validate.c
parentbc0b057e87136f91e81cd2c0f344327dabd21c7f (diff)
downloadmandoc-9f11efb0307eb4c4dbb4a8fff243321100e27573.tar.gz
mandoc-9f11efb0307eb4c4dbb4a8fff243321100e27573.tar.zst
mandoc-9f11efb0307eb4c4dbb4a8fff243321100e27573.zip
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.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c13
1 files changed, 8 insertions, 5 deletions
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 <kristaps@kth.se>
*
@@ -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);