summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2015-04-06 13:34:54 +0000
committerschwarze <schwarze@openbsd.org>2015-04-06 13:34:54 +0000
commit62db39664d4f5caaa94d03811093da9aac235014 (patch)
treea907b2e1f9846df8ab4cec4f7824d7d9b7625f60
parentUse if then else instead of testing $_fstype twice. (diff)
downloadwireguard-openbsd-62db39664d4f5caaa94d03811093da9aac235014.tar.xz
wireguard-openbsd-62db39664d4f5caaa94d03811093da9aac235014.zip
Use the default width for .RS without arguments.
Reduces groff-mandoc differences in base and Xenocara by about 4%. Found while looking at wpa_supplicant(8).
-rw-r--r--regress/usr.bin/mandoc/man/RS/Makefile4
-rw-r--r--regress/usr.bin/mandoc/man/RS/nowidth.in20
-rw-r--r--regress/usr.bin/mandoc/man/RS/nowidth.out_ascii21
-rw-r--r--usr.bin/mandoc/man_term.c6
4 files changed, 47 insertions, 4 deletions
diff --git a/regress/usr.bin/mandoc/man/RS/Makefile b/regress/usr.bin/mandoc/man/RS/Makefile
index 67efb7488d6..4c62bb30e47 100644
--- a/regress/usr.bin/mandoc/man/RS/Makefile
+++ b/regress/usr.bin/mandoc/man/RS/Makefile
@@ -1,7 +1,7 @@
-# $OpenBSD: Makefile,v 1.10 2015/02/06 07:12:34 schwarze Exp $
+# $OpenBSD: Makefile,v 1.11 2015/04/06 13:34:54 schwarze Exp $
REGRESS_TARGETS = breaking broken empty literal lonelyRE
-REGRESS_TARGETS += nested noRE REarg width
+REGRESS_TARGETS += nested noRE nowidth REarg width
LINT_TARGETS = empty lonelyRE noRE REarg
.include <bsd.regress.mk>
diff --git a/regress/usr.bin/mandoc/man/RS/nowidth.in b/regress/usr.bin/mandoc/man/RS/nowidth.in
new file mode 100644
index 00000000000..ee53489a82f
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/RS/nowidth.in
@@ -0,0 +1,20 @@
+.TH RS-NESTED 1 "April 6, 2015" OpenBSD
+.SH NAME
+RS-nowidth \- indentation blocks not specifying a width
+.SH DESCRIPTION
+regular text
+.RS
+top-level indented list
+.RE
+regular text
+.TP 2n
+\(bu
+bullet list
+.RS
+indented text
+.RE
+regular text
+.RS
+top-level indented list
+.RE
+regular text
diff --git a/regress/usr.bin/mandoc/man/RS/nowidth.out_ascii b/regress/usr.bin/mandoc/man/RS/nowidth.out_ascii
new file mode 100644
index 00000000000..c72f18f23e1
--- /dev/null
+++ b/regress/usr.bin/mandoc/man/RS/nowidth.out_ascii
@@ -0,0 +1,21 @@
+RS-NESTED(1) General Commands Manual RS-NESTED(1)
+
+
+
+NNAAMMEE
+ RS-nowidth - indentation blocks not specifying a width
+
+DDEESSCCRRIIPPTTIIOONN
+ regular text
+ top-level indented list
+ regular text
+
+ +o bullet list
+ indented text
+ regular text
+ top-level indented list
+ regular text
+
+
+
+OpenBSD April 6, 2015 RS-NESTED(1)
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 9023d5d8474..066d25c707f 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.129 2015/04/04 18:52:12 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.130 2015/04/06 13:34:54 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -877,7 +877,9 @@ pre_RS(DECL_ARGS)
n = n->parent->head;
n->aux = SHRT_MAX + 1;
- if (n->child != NULL && a2roffsu(n->child->string, &su, SCALE_EN))
+ if (n->child == NULL)
+ n->aux = mt->lmargin[mt->lmargincur];
+ else if (a2roffsu(n->child->string, &su, SCALE_EN))
n->aux = term_hspan(p, &su) / 24;
if (n->aux < 0 && (size_t)(-n->aux) > mt->offset)
n->aux = -mt->offset;