aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/eqn.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-06-26 11:04:47 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-06-26 11:04:47 +0000
commitbaa06147e1a9b5a1f3c9f4a29b58b8722c1fd875 (patch)
tree39c88f01ef6c47febdbc1c68ec48dafa537b9294 /eqn.c
parent1fdb4db7a387f66dbf9fc6b0869d19dfe765a5aa (diff)
downloadmandoc-baa06147e1a9b5a1f3c9f4a29b58b8722c1fd875.tar.gz
mandoc-baa06147e1a9b5a1f3c9f4a29b58b8722c1fd875.tar.zst
mandoc-baa06147e1a9b5a1f3c9f4a29b58b8722c1fd875.zip
when splitting a composite word,
do not forget to close the inserted list box
Diffstat (limited to 'eqn.c')
-rw-r--r--eqn.c17
1 files changed, 10 insertions, 7 deletions
diff --git a/eqn.c b/eqn.c
index 0b961b74..79466093 100644
--- a/eqn.c
+++ b/eqn.c
@@ -1,4 +1,4 @@
-/* $Id: eqn.c,v 1.69 2017/06/23 21:04:57 schwarze Exp $
+/* $Id: eqn.c,v 1.70 2017/06/26 11:04:47 schwarze Exp $ */
/*
* Copyright (c) 2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -722,7 +722,7 @@ static enum rofferr
eqn_parse(struct eqn_node *ep, struct eqn_box *parent)
{
char sym[64];
- struct eqn_box *cur, *nbox;
+ struct eqn_box *cur, *nbox, *split;
const char *cp, *cpn, *start;
char *p;
size_t sz;
@@ -1118,6 +1118,7 @@ this_tok:
break;
cpn = p - 1;
ccln = CCL_LET;
+ split = NULL;
for (;;) {
/* Advance to next character. */
cp = cpn++;
@@ -1149,13 +1150,13 @@ this_tok:
parent->last = cur->prev;
parent->args--;
/* Set up a list instead. */
- nbox = eqn_box_alloc(ep, parent);
- nbox->type = EQN_LIST;
+ split = eqn_box_alloc(ep, parent);
+ split->type = EQN_LIST;
/* Insert the word into the list. */
- nbox->first = nbox->last = cur;
- cur->parent = nbox;
+ split->first = split->last = cur;
+ cur->parent = split;
cur->prev = NULL;
- parent = nbox;
+ parent = split;
}
/* Append a new text box. */
nbox = eqn_box_alloc(ep, parent);
@@ -1172,6 +1173,8 @@ this_tok:
cpn = p - 1;
ccln = CCL_LET;
}
+ if (split != NULL)
+ parent = split->parent;
break;
}
/*