summaryrefslogtreecommitdiffstats
path: root/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2014-10-20 02:33:06 +0000
committerIngo Schwarze <schwarze@openbsd.org>2014-10-20 02:33:06 +0000
commit92a2c903373c2aae7aa1d0c680626b21f4011848 (patch)
treeafd8be1ad2fcc51a65fd23aef90e97b6eb0386e3 /roff.c
parent1ef973217e594b4c3a9888b786a447856f0de8db (diff)
downloadmandoc-92a2c903373c2aae7aa1d0c680626b21f4011848.tar.gz
correct spacing before inline equations
Diffstat (limited to 'roff.c')
-rw-r--r--roff.c14
1 files changed, 3 insertions, 11 deletions
diff --git a/roff.c b/roff.c
index c68c88ff..d5bc54e2 100644
--- a/roff.c
+++ b/roff.c
@@ -1872,19 +1872,11 @@ roff_eqndelim(struct roff *r, char **bufp, size_t *szp, int pos)
if (cp2 == NULL)
return(ROFF_CONT);
- /* Found a delimiter; get rid of surrounding blanks. */
-
- cp1 = cp2++;
- while (cp2[0] == ' ')
- cp2++;
- while (cp1[-1] == ' ')
- cp1--;
- *cp1 = '\0';
-
/* Replace the delimiter with an equation macro. */
- *szp = mandoc_asprintf(&cp1, "%s\n.E%s%s", *bufp,
- r->eqn == NULL ? "Q\n" : "N\n\\&", cp2) + 1;
+ *cp2++ = '\0';
+ *szp = mandoc_asprintf(&cp1, "%s%s%s", *bufp,
+ r->eqn == NULL ? "\\&\n.EQ\n" : "\n.EN\n\\&", cp2) + 1;
free(*bufp);
*bufp = cp1;