summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 5390158d..41207cab 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -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);