summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--eqn.72
-rw-r--r--eqn.c10
2 files changed, 8 insertions, 4 deletions
diff --git a/eqn.7 b/eqn.7
index b4910b2e..4d0d2e0d 100644
--- a/eqn.7
+++ b/eqn.7
@@ -72,7 +72,7 @@ box : text
| pile { list }
| font box
| SIZE text box
- | LEFT text box [RIGHT text]
+ | LEFT text eqn [RIGHT text]
text : TEXT
pile : LPILE
| CPILE
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);