summaryrefslogtreecommitdiffstats
path: root/macro.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2009-01-12 10:31:53 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2009-01-12 10:31:53 +0000
commit062881c5bc9c7803c1b4caaca0d73dfd937f3445 (patch)
tree4eef2bacce9049ce36b7779756435cbc274a4dc9 /macro.c
parent9a5b4bcb2e33907e5840f6a576a7cac39f080343 (diff)
downloadmandoc-062881c5bc9c7803c1b4caaca0d73dfd937f3445.tar.gz
*** empty log message ***
Diffstat (limited to 'macro.c')
-rw-r--r--macro.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/macro.c b/macro.c
index e8da371e..74764e53 100644
--- a/macro.c
+++ b/macro.c
@@ -153,10 +153,10 @@ rewind_expblock(struct mdoc *mdoc, int tok)
struct mdoc_node *n;
int t;
- assert(mdoc->last);
+ n = mdoc->last ? mdoc->last->parent : NULL;
/* LINTED */
- for (n = mdoc->last; n; n = n->parent) {
+ for ( ; n; n = n->parent) {
if (MDOC_BLOCK != n->type)
continue;
if (tok == (t = n->data.block.tok))
@@ -187,7 +187,7 @@ rewind_impblock(struct mdoc *mdoc, int tok)
break;
if ( ! (MDOC_EXPLICIT & mdoc_macros[t].flags))
continue;
- if (MDOC_NESTED & mdoc_macros[t].flags)
+ if (MDOC_NESTED & mdoc_macros[tok].flags)
return(1);
return(mdoc_verr(mdoc, n, ERR_SCOPE_BREAK));
}
@@ -293,7 +293,7 @@ macro_close_explicit(MACRO_PROT_ARGS)
}
if ( ! (MDOC_CALLABLE & mdoc_macros[tok].flags)) {
- if (buf[*pos])
+ if (0 == buf[*pos])
return(rewind_expblock(mdoc, tt));
return(mdoc_perr(mdoc, line, ppos, ERR_ARGS_EQ0));
}