summaryrefslogtreecommitdiffstats
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 16:24:37 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-05-15 16:24:37 +0000
commit2f01ab1363bf6ab718b3fb6370fc6735e3e8bc02 (patch)
treec8023c62b35846d97b0c170d0fc13e02159140a7 /mdoc_validate.c
parent6e9d908aceac4cb4aaf9a8d2bdeab9efea064b7b (diff)
downloadmandoc-2f01ab1363bf6ab718b3fb6370fc6735e3e8bc02.tar.gz
LIBRARY can also occur in section 9.
All manual sections (unknown, 3p, 3f, etc.) correctly handled by -mdoc. Useful warning printed if unknown manual section. Checking for manual sections (e.g., LIBRARY) checks only first character, so 3p, 3f, etc. are free.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c17
1 files changed, 8 insertions, 9 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index e79796e9..0b3bf0f4 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1240,20 +1240,19 @@ post_sh_head(POST_ARGS)
/*
* Check particular section/manual conventions. LIBRARY can
- * only occur in msec 2, 3 (TODO: are there more of these?).
+ * only occur in manual section 2, 3, and 9.
*/
switch (sec) {
case (SEC_LIBRARY):
- switch (mdoc->meta.msec) {
- case (2):
- /* FALLTHROUGH */
- case (3):
+ assert(mdoc->meta.msec);
+ if (*mdoc->meta.msec == '2')
break;
- default:
- return(mdoc_nwarn(mdoc, mdoc->last, EWRONGMSEC));
- }
- break;
+ if (*mdoc->meta.msec == '3')
+ break;
+ if (*mdoc->meta.msec == '9')
+ break;
+ return(mdoc_nwarn(mdoc, mdoc->last, EWRONGMSEC));
default:
break;
}