diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-08-23 20:29:39 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2017-08-23 20:29:39 +0000 |
commit | 3ff7c534d9f61038c8b82b0a75499e2797e7a1dd (patch) | |
tree | b867b9edbafd93db005d39f527fc0d943e6f167b /usr.bin | |
parent | d9b9b9ba4120aafb9f1f9008845692d841f9dab4 (diff) |
eliminate white space after opening and before closing punctuation
Diffstat (limited to 'usr.bin')
-rw-r--r-- | usr.bin/mandoc/eqn_term.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/usr.bin/mandoc/eqn_term.c b/usr.bin/mandoc/eqn_term.c index 9be5305a68b..ea610ab02ed 100644 --- a/usr.bin/mandoc/eqn_term.c +++ b/usr.bin/mandoc/eqn_term.c @@ -1,4 +1,4 @@ -/* $OpenBSD: eqn_term.c,v 1.10 2017/08/23 20:02:48 schwarze Exp $ */ +/* $OpenBSD: eqn_term.c,v 1.11 2017/08/23 20:29:38 schwarze Exp $ */ /* * Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org> @@ -88,8 +88,14 @@ eqn_box(struct termp *p, const struct eqn_box *bp) if (bp->font != EQNFONT_NONE) term_fontpush(p, fontmap[(int)bp->font]); - if (bp->text != NULL) + if (bp->text != NULL) { + if (strchr("!\"'),.:;?]}", *bp->text) != NULL) + p->flags |= TERMP_NOSPACE; term_word(p, bp->text); + if (*bp->text != '\0' && strchr("\"'([{", + bp->text[strlen(bp->text) - 1]) != NULL) + p->flags |= TERMP_NOSPACE; + } /* Special box types. */ |