diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-04-03 14:02:10 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2010-04-03 14:02:10 +0000 |
commit | 59c7bc58d7303ddeb6eb395dc50a072f2ed339f5 (patch) | |
tree | 7f3504c6d42d01d731e46758220cef92739731a7 /mdoc_validate.c | |
parent | a907445c2b200a31f661cd37cd622ec9328eb04d (diff) | |
download | mandoc-59c7bc58d7303ddeb6eb395dc50a072f2ed339f5.tar.gz mandoc-59c7bc58d7303ddeb6eb395dc50a072f2ed339f5.tar.zst mandoc-59c7bc58d7303ddeb6eb395dc50a072f2ed339f5.zip |
Merged Ingo Schwarze's patch (plus documentation) for removing extraneous list types, which happens fairly often.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r-- | mdoc_validate.c | 17 |
1 files changed, 14 insertions, 3 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c index e83b4c2b..f63bae4e 100644 --- a/mdoc_validate.c +++ b/mdoc_validate.c @@ -1,4 +1,4 @@ -/* $Id: mdoc_validate.c,v 1.60 2010/04/03 13:02:35 kristaps Exp $ */ +/* $Id: mdoc_validate.c,v 1.61 2010/04/03 14:02:10 kristaps Exp $ */ /* * Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se> * @@ -621,8 +621,19 @@ 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. + */ + 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): |