summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2017-08-23 20:48:56 +0000
committerschwarze <schwarze@openbsd.org>2017-08-23 20:48:56 +0000
commit4c273204e2babbfd73532c3677c8c07edbc9119a (patch)
tree21c2a6bf2f30ae7c6035a7df0e3b2cf99b963cf1
parenteliminate white space after opening and before closing punctuation (diff)
downloadwireguard-openbsd-4c273204e2babbfd73532c3677c8c07edbc9119a.tar.xz
wireguard-openbsd-4c273204e2babbfd73532c3677c8c07edbc9119a.zip
remove spacing after unary minus
-rw-r--r--usr.bin/mandoc/eqn_term.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/usr.bin/mandoc/eqn_term.c b/usr.bin/mandoc/eqn_term.c
index ea610ab02ed..03f7ee01c22 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.11 2017/08/23 20:29:38 schwarze Exp $ */
+/* $OpenBSD: eqn_term.c,v 1.12 2017/08/23 20:48:56 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2014, 2015, 2017 Ingo Schwarze <schwarze@openbsd.org>
@@ -50,6 +50,7 @@ static void
eqn_box(struct termp *p, const struct eqn_box *bp)
{
const struct eqn_box *child;
+ const char *cp;
int delim;
/* Delimiters around this box? */
@@ -92,8 +93,9 @@ eqn_box(struct termp *p, const struct eqn_box *bp)
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)
+ if ((cp = strchr(bp->text, '\0')) > bp->text &&
+ ((cp[-1] == '-' && bp->prev == NULL) ||
+ strchr("\"'([{", cp[-1]) != NULL))
p->flags |= TERMP_NOSPACE;
}