summaryrefslogtreecommitdiff
path: root/usr.bin
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2015-03-09 17:41:37 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2015-03-09 17:41:37 +0000
commit34fe11188145c9bfe3918f1bc2dd27cc41ba3139 (patch)
tree7e3399cdd559291868fc3237169252724b52628d /usr.bin
parent9ed1e68c1130c2fe7fa16e7e68dc826e581d17fe (diff)
Fix vertical spacing at the beginning of tables.
man(7) always prints a blank line, mdoc(7) doesn't. Problem in mdoc(7) reported by kristaps@. mdoc(7) part of the patch tested by kristaps@.
Diffstat (limited to 'usr.bin')
-rw-r--r--usr.bin/mandoc/man_term.c10
-rw-r--r--usr.bin/mandoc/mdoc_term.c4
-rw-r--r--usr.bin/mandoc/tbl_term.c5
3 files changed, 7 insertions, 12 deletions
diff --git a/usr.bin/mandoc/man_term.c b/usr.bin/mandoc/man_term.c
index 58bc565e7da..56cfc03c7d5 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.121 2015/01/30 22:04:15 schwarze Exp $ */
+/* $OpenBSD: man_term.c,v 1.122 2015/03/09 17:41:36 schwarze Exp $ */
/*
* Copyright (c) 2008-2012 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -943,12 +943,8 @@ print_man_node(DECL_ARGS)
p->flags |= TERMP_NOSPACE;
return;
case MAN_TBL:
- /*
- * Tables are preceded by a newline. Then process a
- * table line, which will cause line termination,
- */
- if (n->span->prev == NULL)
- term_newln(p);
+ if (p->tbl.cols == NULL)
+ term_vspace(p);
term_tbl(p, n->span);
return;
default:
diff --git a/usr.bin/mandoc/mdoc_term.c b/usr.bin/mandoc/mdoc_term.c
index 659d455fc36..5a9ec602703 100644
--- a/usr.bin/mandoc/mdoc_term.c
+++ b/usr.bin/mandoc/mdoc_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: mdoc_term.c,v 1.211 2015/03/09 17:37:45 schwarze Exp $ */
+/* $OpenBSD: mdoc_term.c,v 1.212 2015/03/09 17:41:36 schwarze Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2012-2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -346,6 +346,8 @@ print_mdoc_node(DECL_ARGS)
p->flags |= TERMP_NOSPACE;
break;
case MDOC_TBL:
+ if (p->tbl.cols == NULL)
+ term_newln(p);
term_tbl(p, n->span);
break;
default:
diff --git a/usr.bin/mandoc/tbl_term.c b/usr.bin/mandoc/tbl_term.c
index 7ff3e983564..7f9080519c2 100644
--- a/usr.bin/mandoc/tbl_term.c
+++ b/usr.bin/mandoc/tbl_term.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tbl_term.c,v 1.27 2015/03/09 17:30:29 schwarze Exp $ */
+/* $OpenBSD: tbl_term.c,v 1.28 2015/03/09 17:41:36 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org>
@@ -64,9 +64,6 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
size_t rmargin, maxrmargin, tsz;
int ic, horiz, spans, vert;
- if (tp->tbl.cols == NULL)
- term_flushln(tp);
-
rmargin = tp->rmargin;
maxrmargin = tp->maxrmargin;