aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/mdoc_validate.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2010-07-02 13:12:47 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2010-07-02 13:12:47 +0000
commit810f75ce83e5d6362d138c5e9ccfe24c23ae8509 (patch)
treeacb4dc13cbca8c36d05568537402dd64c9a9966b /mdoc_validate.c
parent576d44deebc6c4af088d980a61e9a3a7e05087d7 (diff)
downloadmandoc-810f75ce83e5d6362d138c5e9ccfe24c23ae8509.tar.gz
mandoc-810f75ce83e5d6362d138c5e9ccfe24c23ae8509.tar.zst
mandoc-810f75ce83e5d6362d138c5e9ccfe24c23ae8509.zip
Fix: was checking HEAD for arguments.
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 6e839e78..f16ed8d3 100644
--- a/mdoc_validate.c
+++ b/mdoc_validate.c
@@ -1,4 +1,4 @@
-/* $Id: mdoc_validate.c,v 1.105 2010/07/02 12:54:33 kristaps Exp $ */
+/* $Id: mdoc_validate.c,v 1.106 2010/07/02 13:12:47 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -957,6 +957,8 @@ post_bf(POST_ARGS)
}
np = mdoc->last;
+ assert(MDOC_BLOCK == np->parent->type);
+ assert(MDOC_Bf == np->parent->tok);
np->data.Bf = mandoc_calloc(1, sizeof(struct mdoc_bf));
/*
@@ -964,16 +966,16 @@ post_bf(POST_ARGS)
* If neither is specified, let it through with a warning.
*/
- if (np->args && np->child) {
+ if (np->parent->args && np->child) {
mdoc_nmsg(mdoc, np, MANDOCERR_SYNTARGVCOUNT);
return(0);
- } else if (NULL == np->args && NULL == np->child)
+ } else if (NULL == np->parent->args && NULL == np->child)
return(mdoc_nmsg(mdoc, np, MANDOCERR_FONTTYPE));
/* Extract argument into data. */
- if (np->args) {
- arg = np->args->argv[0].arg;
+ if (np->parent->args) {
+ arg = np->parent->args->argv[0].arg;
if (MDOC_Emphasis == arg)
np->data.Bf->font = FONT_Em;
else if (MDOC_Literal == arg)