summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-11-23 19:15:32 +0000
committerschwarze <schwarze@openbsd.org>2018-11-23 19:15:32 +0000
commit65433e6ff606a8aca58d614cdb095d6963da6d6c (patch)
treec780f2d4232c214e84db65fa8c2de0a75b36f6e6
parentsync (diff)
downloadwireguard-openbsd-65433e6ff606a8aca58d614cdb095d6963da6d6c.tar.xz
wireguard-openbsd-65433e6ff606a8aca58d614cdb095d6963da6d6c.zip
When a font escape appears in the middle of a string,
make sure it doesn't cause output of bogus whitespace. Fixing a bug reported by Pali dot Rohar at gmail dot com.
-rw-r--r--usr.bin/mandoc/html.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/usr.bin/mandoc/html.c b/usr.bin/mandoc/html.c
index 948d43da915..a76a96ce269 100644
--- a/usr.bin/mandoc/html.c
+++ b/usr.bin/mandoc/html.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: html.c,v 1.112 2018/10/25 01:21:30 schwarze Exp $ */
+/* $OpenBSD: html.c,v 1.113 2018/11/23 19:15:32 schwarze Exp $ */
/*
* Copyright (c) 2008-2011, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -414,8 +414,11 @@ print_encode(struct html *h, const char *p, const char *pend, int norecurse)
case ESCAPE_FONTBI:
case ESCAPE_FONTCW:
case ESCAPE_FONTROMAN:
- if (0 == norecurse)
+ if (0 == norecurse) {
+ h->flags |= HTML_NOSPACE;
print_metaf(h, esc);
+ h->flags &= ~HTML_NOSPACE;
+ }
continue;
case ESCAPE_SKIPCHAR:
h->flags |= HTML_SKIPCHAR;