From 619da5a7b0c931ea622bdd14c639e77e854f5ba1 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 15 May 2010 16:24:37 +0000 Subject: 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. --- mdoc_validate.c | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) (limited to 'mdoc_validate.c') 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 * @@ -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; } -- cgit v1.2.3-56-ge451