diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-10-20 02:31:45 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2014-10-20 02:31:45 +0000 |
commit | 1689a30680d2082efd2f568af17662ed9001b6fb (patch) | |
tree | 051e8f37513ff660511717d97f13326ab0071e83 /usr.bin/mandoc/roff.c | |
parent | 1e42cca21472fabac95743c241b888fb8d4bfef9 (diff) |
correct spacing before inline equations
Diffstat (limited to 'usr.bin/mandoc/roff.c')
-rw-r--r-- | usr.bin/mandoc/roff.c | 16 |
1 files changed, 4 insertions, 12 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index 831357989c9..c65fa2f009c 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $OpenBSD: roff.c,v 1.103 2014/10/16 01:27:48 schwarze Exp $ */ +/* $OpenBSD: roff.c,v 1.104 2014/10/20 02:31:44 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010-2014 Ingo Schwarze <schwarze@openbsd.org> @@ -1870,19 +1870,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; |