=================================================================== RCS file: /cvs/mandoc/mdoc_validate.c,v retrieving revision 1.59 retrieving revision 1.62 diff -u -p -r1.59 -r1.62 --- mandoc/mdoc_validate.c 2010/03/31 07:13:53 1.59 +++ mandoc/mdoc_validate.c 2010/04/03 14:12:48 1.62 @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.59 2010/03/31 07:13:53 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.62 2010/04/03 14:12:48 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons * @@ -621,8 +621,21 @@ pre_bl(PRE_ARGS) case (MDOC_Inset): /* FALLTHROUGH */ case (MDOC_Column): - if (type >= 0) - return(mdoc_nerr(mdoc, n, EMULTILIST)); + /* + * Note that if a duplicate is detected, we + * remove the duplicate instead of passing it + * over. If we don't do this, mdoc_action will + * become confused when it scans over multiple + * types whilst setting its bitmasks. + * + * FIXME: this should occur in mdoc_action.c. + */ + if (type >= 0) { + if ( ! mdoc_nwarn(mdoc, n, EMULTILIST)) + return(0); + mdoc_argn_free(n->args, pos); + break; + } type = n->args->argv[pos].arg; break; case (MDOC_Compact): @@ -1308,8 +1321,9 @@ post_sh_head(POST_ARGS) * non-CUSTOM has a conventional order to be followed. */ - if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed) - return(mdoc_nerr(mdoc, mdoc->last, ESECNAME)); + if (SEC_NAME != sec && SEC_NONE == mdoc->lastnamed && + ! mdoc_nwarn(mdoc, mdoc->last, ESECNAME)) + return(0); if (SEC_CUSTOM == sec) return(1); if (sec == mdoc->lastnamed)