summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-04-04 13:52:59 +0000
committerschwarze <schwarze@openbsd.org>2015-04-04 13:52:59 +0000
commit52b834b3d3e2c1258dfa64f79e74e6937b3d083a (patch)
treebb5f3b10f5c63230f2acd6e46451a598f937b56a
parentUse config_suspend() instead of dereferencing ca_activate directly to (diff)
downloadwireguard-openbsd-52b834b3d3e2c1258dfa64f79e74e6937b3d083a.tar.xz
wireguard-openbsd-52b834b3d3e2c1258dfa64f79e74e6937b3d083a.zip
Don't allow breaking the output line after hyphens following escape
sequences. Improves tic(1), sxpm(1), and a few Perl manuals. Quirk found by naddy@ in milter-greylist(8).
-rw-r--r--usr.bin/mandoc/roff.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index 3835f1adbfa..32b7f1d30c4 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: roff.c,v 1.135 2015/02/21 14:46:33 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.136 2015/04/04 13:52:59 schwarze Exp $ */
/*
* Copyright (c) 2010, 2011, 2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -1126,6 +1126,8 @@ roff_parsetext(struct buf *buf, int pos, int *offs)
esc = mandoc_escape((const char **)&p, NULL, NULL);
if (esc == ESCAPE_ERROR)
break;
+ while (*p == '-')
+ p++;
continue;
} else if (p == start) {
p++;