summaryrefslogtreecommitdiffstatshomepage
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
commit619da5a7b0c931ea622bdd14c639e77e854f5ba1 (patch)
treed3dd14dbfee0e608080f6ca7729bfedd65fc0fec /mdoc_validate.c
parenta251336e2327592d09bff64e10e8e344a47a4374 (diff)
downloadmandoc-619da5a7b0c931ea622bdd14c639e77e854f5ba1.tar.gz
mandoc-619da5a7b0c931ea622bdd14c639e77e854f5ba1.tar.zst
mandoc-619da5a7b0c931ea622bdd14c639e77e854f5ba1.zip
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.c19
1 files changed, 9 insertions, 10 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index e5fdb495..44d71185 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.77 2010/05/14 17:54:26 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.78 2010/05/15 16:24:38 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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;
}