summaryrefslogtreecommitdiffstatshomepage
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
commit569c276460dfd948ab28a199826274e234cf815c (patch)
tree8942f866e4ed15b8efe1fd826e2fab985a867c60 /macro.c
parent66dcb58e3397f627b870f3d66d6d1460bbb1b052 (diff)
downloadmandoc-569c276460dfd948ab28a199826274e234cf815c.tar.gz
mandoc-569c276460dfd948ab28a199826274e234cf815c.tar.zst
mandoc-569c276460dfd948ab28a199826274e234cf815c.zip
*** empty log message ***
Diffstat (limited to 'macro.c')
-rw-r--r--macro.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/macro.c b/macro.c
index 352af8be..56da7aac 100644
--- a/macro.c
+++ b/macro.c
@@ -1,4 +1,4 @@
-/* $Id: macro.c,v 1.30 2009/01/09 14:45:44 kristaps Exp $ */
+/* $Id: macro.c,v 1.31 2009/01/12 10:31:53 kristaps Exp $ */
/*
* Copyright (c) 2008 Kristaps Dzonsons <kristaps@kth.se>
*
@@ -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));
}