summaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-06-12 09:18:00 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-06-12 09:18:00 +0000
commit0214fa880cd249945951f08bfcf80004d5e6f43f (patch)
tree55b4a2e6eb6657ee1288f835fa1b057fa4e1451d /mdoc_validate.c
parentad41f399a1fe056e9e22b214c75f2057a063ef44 (diff)
downloadmandoc-0214fa880cd249945951f08bfcf80004d5e6f43f.tar.gz
mandoc-0214fa880cd249945951f08bfcf80004d5e6f43f.tar.zst
mandoc-0214fa880cd249945951f08bfcf80004d5e6f43f.zip
`Lk' is correctly handled as CALLABLE (note groff munges nested output).
`Mt' is now CALLABLE. Fixed missing validate/action of zero-element, non-called inline elements. Fixed missing validate/action of nested inline element re-calls. Fixed bogus column argv index in validator.
Diffstat (limited to 'mdoc_validate.c')
-rw-r--r--mdoc_validate.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/mdoc_validate.c b/mdoc_validate.c
index 1da8a28d..900f07fc 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.8 2009/06/11 10:34:31 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.9 2009/06/12 09:18:00 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -300,7 +300,7 @@ const struct valids mdoc_valids[MDOC_MAX] = {
{ pres_lb, posts_lb }, /* Lb */
{ NULL, NULL }, /* Ap */
{ NULL, posts_pp }, /* Lp */
- { NULL, posts_text }, /* Lk */
+ { NULL, NULL }, /* Lk */
{ NULL, posts_text }, /* Mt */
{ NULL, posts_wline }, /* Brq */
{ NULL, NULL }, /* Bro */
@@ -789,7 +789,7 @@ pre_display(PRE_ARGS)
static int
pre_bl(PRE_ARGS)
{
- int pos, type, width, offset;
+ int pos, col, type, width, offset;
if (MDOC_BLOCK != n->type)
return(1);
@@ -798,7 +798,7 @@ pre_bl(PRE_ARGS)
/* Make sure that only one type of list is specified. */
- type = offset = width = -1;
+ type = offset = width = col = -1;
/* LINTED */
for (pos = 0; pos < (int)n->args->argc; pos++)
@@ -827,6 +827,7 @@ pre_bl(PRE_ARGS)
if (-1 != type)
return(nerr(mdoc, n, EMULTILIST));
type = n->args->argv[pos].arg;
+ col = pos;
break;
case (MDOC_Width):
if (-1 != width)
@@ -876,7 +877,8 @@ pre_bl(PRE_ARGS)
switch (type) {
case (MDOC_Column):
- if (0 == n->args->argv[pos].sz)
+ assert(col >= 0);
+ if (0 == n->args->argv[col].sz)
break;
if ( ! nwarn(mdoc, n, WDEPCOL))
return(0);