diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-12 08:41:17 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-05-12 08:41:17 +0000 |
commit | 2e08684b6f7079837888e14e0a2129df281b31e8 (patch) | |
tree | 1114a34b670fa4462fe646d8deae3992e3d3eb70 /mdoc_validate.c | |
parent | 1caded1c8245d6b49a1f14453cd477f5c5920a15 (diff) | |
download | mandoc-2e08684b6f7079837888e14e0a2129df281b31e8.tar.gz |
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.c | 11 |
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); |