summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-04-19 19:43:50 +0000
committerschwarze <schwarze@openbsd.org>2015-04-19 19:43:50 +0000
commit5ce49a8e00011c89142566c2ee302e2066a989e1 (patch)
treed18363d836c3f16bc6cf66e07babd145f60ac3e2 /usr.bin/mandoc/man_term.c
parentsync (diff)
downloadwireguard-openbsd-5ce49a8e00011c89142566c2ee302e2066a989e1.tar.xz
wireguard-openbsd-5ce49a8e00011c89142566c2ee302e2066a989e1.zip
If an explicit line break request (.br or .sp) occurs within an .HP block,
the next line doesn't hang, but is simply indented. Issue found by Christian Neukirchen <chneukirchen at gmail dot com> in the dmsetup(8) manual on Linux. This patch also improves the indentation of XDGA(3) and XrmGetResource(3).
Diffstat (limited to 'usr.bin/mandoc/man_term.c')
-rw-r--r--usr.bin/mandoc/man_term.c13
1 files changed, 12 insertions, 1 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 46547750118..028a92dcea2 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: man_term.c,v 1.135 2015/04/19 13:59:37 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.136 2015/04/19 19:43:50 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -480,6 +480,17 @@ pre_sp(DECL_ARGS)
for (i = 0; i < len; i++)
term_vspace(p);
+ /*
+ * Handle an explicit break request in the same way
+ * as an overflowing line.
+ */
+
+ if (p->flags & TERMP_BRIND) {
+ p->offset = p->rmargin;
+ p->rmargin = p->maxrmargin;
+ p->flags &= ~(TERMP_NOBREAK | TERMP_BRIND);
+ }
+
return(0);
}