From 7881c2f8ae736bd068a654503612ac7b0e12a24f Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Mon, 20 Oct 2014 02:33:06 +0000 Subject: correct spacing before inline equations --- roff.c | 16 ++++------------ 1 file changed, 4 insertions(+), 12 deletions(-) (limited to 'roff.c') diff --git a/roff.c b/roff.c index 97ae08d8..a395b83c 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.231 2014/10/16 01:28:38 schwarze Exp $ */ +/* $Id: roff.c,v 1.232 2014/10/20 02:33:06 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2010-2014 Ingo Schwarze @@ -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; -- cgit v1.2.3