aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2012-07-14 10:47:07 +0000
committerIngo Schwarze <schwarze@openbsd.org>2012-07-14 10:47:07 +0000
commit41e81f9fc56dbe499ec91216e92df0095d1e5eb5 (patch)
treec3be7d6daffe938a81ec26adda5865624f3937eb
parentf5916232841f68e5d069fb2218e04f5f8c5a2c9e (diff)
downloadmandoc-41e81f9fc56dbe499ec91216e92df0095d1e5eb5.tar.gz
mandoc-41e81f9fc56dbe499ec91216e92df0095d1e5eb5.tar.zst
mandoc-41e81f9fc56dbe499ec91216e92df0095d1e5eb5.zip
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. OpenBSD rev. man.c 1.68 and man_term.c 1.86
-rw-r--r--man.c7
-rw-r--r--man_term.c19
2 files changed, 19 insertions, 7 deletions
diff --git a/man.c b/man.c
index d2297251..e1a7d94d 100644
--- a/man.c
+++ b/man.c
@@ -1,4 +1,4 @@
-/* $Id: man.c,v 1.117 2012/06/12 20:21:04 kristaps Exp $ */
+/* $Id: man.c,v 1.118 2012/07/14 10:47:07 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -435,9 +435,10 @@ man_ptext(struct man *m, int line, char *buf, int offs)
if ('\0' == buf[i]) {
/* Allocate a blank entry. */
- if ( ! man_word_alloc(m, line, offs, ""))
+ if ( ! man_elem_alloc(m, line, offs, MAN_sp))
return(0);
- return(man_descope(m, line, offs));
+ m->next = MAN_NEXT_SIBLING;
+ return(1);
}
/*
diff --git a/man_term.c b/man_term.c
index 14e13246..93f927d9 100644
--- a/man_term.c
+++ b/man_term.c
@@ -1,4 +1,4 @@
-/* $Id: man_term.c,v 1.131 2012/07/13 14:19:49 schwarze Exp $ */
+/* $Id: man_term.c,v 1.132 2012/07/14 10:47:07 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011, 2012 Ingo Schwarze <schwarze@openbsd.org>
@@ -445,10 +445,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;