aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/eqn_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-08-23 21:56:20 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-08-23 21:56:20 +0000
commitcc41b18e34d71f6b71a09e42ef7317cbc7dedc57 (patch)
treeca9cb2e6c1e7b3e2e0df5983992d48d4924cf5b2 /eqn_term.c
parentdd58bb87ae1e6e8e50fb78516797ec7709c92b7a (diff)
downloadmandoc-cc41b18e34d71f6b71a09e42ef7317cbc7dedc57.tar.gz
mandoc-cc41b18e34d71f6b71a09e42ef7317cbc7dedc57.tar.zst
mandoc-cc41b18e34d71f6b71a09e42ef7317cbc7dedc57.zip
remove spacing after another representation of unary minus
Diffstat (limited to 'eqn_term.c')
-rw-r--r--eqn_term.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/eqn_term.c b/eqn_term.c
index 1b702841..669c3c56 100644
--- a/eqn_term.c
+++ b/eqn_term.c
@@ -1,4 +1,4 @@
-/* $Id: eqn_term.c,v 1.16 2017/08/23 20:49:15 schwarze Exp $ */
+/* $Id: eqn_term.c,v 1.17 2017/08/23 21:56:20 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -96,8 +96,10 @@ eqn_box(struct termp *p, const struct eqn_box *bp)
p->flags |= TERMP_NOSPACE;
term_word(p, bp->text);
if ((cp = strchr(bp->text, '\0')) > bp->text &&
- ((cp[-1] == '-' && bp->prev == NULL) ||
- strchr("\"'([{", cp[-1]) != NULL))
+ (strchr("\"'([{", cp[-1]) != NULL ||
+ (bp->prev == NULL && (cp[-1] == '-' ||
+ (cp >= bp->text + 5 &&
+ strcmp(cp - 5, "\\[mi]") == 0)))))
p->flags |= TERMP_NOSPACE;
}