summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/man_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2012-07-14 10:43:49 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2012-07-14 10:43:49 +0000
commita2f1ac7e10563b50daa35c56d00d2b2ed809edbe (patch)
tree23b492a713c46a13766d450e7b3dabbda28de2cb /usr.bin/mandoc/man_term.c
parent2b6567a7e3007502222f44800ee17b7fc24e083a (diff)
Translate blank input lines to .sp just like in mdoc(7),
and ignore .sp after .PP. This fixes vertical spacing for blank lines after .PP and for .sp after .PP.
Diffstat (limited to 'usr.bin/mandoc/man_term.c')
-rw-r--r--usr.bin/mandoc/man_term.c19
1 files changed, 15 insertions, 4 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index b14ca7726d3..1be65baa9e5 100644
--- a/usr.bin/mandoc/man_term.c
+++ b/usr.bin/mandoc/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.85 2012/07/13 14:15:50 schwarze Exp $ */
+/* $Id: man_term.c,v 1.86 2012/07/14 10:43:48 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -441,10 +441,21 @@ pre_sp(DECL_ARGS)
int neg;
if ((NULL == n->prev && n->parent)) {
- if (MAN_SS == n->parent->tok)
- return(0);
- if (MAN_SH == n->parent->tok)
+ switch (n->parent->tok) {
+ case (MAN_SH):
+ /* FALLTHROUGH */
+ case (MAN_SS):
+ /* FALLTHROUGH */
+ case (MAN_PP):
+ /* FALLTHROUGH */
+ case (MAN_LP):
+ /* FALLTHROUGH */
+ case (MAN_P):
+ /* FALLTHROUGH */
return(0);
+ default:
+ break;
+ }
}
neg = 0;