summaryrefslogtreecommitdiffstats
path: root/eqn.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-07-22 12:55:02 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-07-22 12:55:02 +0000
commitef8ac52af2edf966a10f6060c0cbf8fac09c298d (patch)
tree2d3e5761d6d6eb7f1a4ac4aadc01800c8d8def63 /eqn.c
parent16b40a0ceac84afe1ca3122b48c8cb7ef28111cf (diff)
downloadmandoc-ef8ac52af2edf966a10f6060c0cbf8fac09c298d.tar.gz
Fix left/right nesting in eqn.
Diffstat (limited to 'eqn.c')
-rw-r--r--eqn.c10
1 files changed, 7 insertions, 3 deletions
diff --git a/eqn.c b/eqn.c
index 52b76c45..89147416 100644
--- a/eqn.c
+++ b/eqn.c
@@ -309,14 +309,18 @@ eqn_box(struct eqn_node *ep, struct eqn_box *last)
return(EQN_ERR);
}
left = mandoc_strndup(start, sz);
- if (EQN_DESCOPE != (c = eqn_eqn(ep, last)))
+ c = eqn_eqn(ep, last);
+ if (last->last)
+ last->last->left = left;
+ else
+ free(left);
+ if (EQN_DESCOPE != c)
return(c);
assert(last->last);
- last->last->left = left;
eqn_rewind(ep);
start = eqn_nexttok(ep, &sz);
assert(start);
- if (STRNEQ(start, sz, "right", 5))
+ if ( ! STRNEQ(start, sz, "right", 5))
return(EQN_DESCOPE);
if (NULL == (start = eqn_nexttok(ep, &sz))) {
EQN_MSG(MANDOCERR_EQNEOF, ep);