diff options
author | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-03-09 17:30:30 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@cvs.openbsd.org> | 2015-03-09 17:30:30 +0000 |
commit | e56ac803f46aa9c48a064574f53e586f2491aed1 (patch) | |
tree | 69089d76feeaa8edd8ef3485f0ebbea91d0aa8da /usr.bin/mandoc/tbl_term.c | |
parent | cf5e350fc224bdc18ec7a3ddd6134e62d8678cf2 (diff) |
Flush the line preceding a table before clearing the right margin,
such that that line isn't output with unlimited width.
Problem reported and fix OK by kristaps@.
Diffstat (limited to 'usr.bin/mandoc/tbl_term.c')
-rw-r--r-- | usr.bin/mandoc/tbl_term.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/usr.bin/mandoc/tbl_term.c b/usr.bin/mandoc/tbl_term.c index afad57d7074..7ff3e983564 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.26 2015/01/31 00:11:52 schwarze Exp $ */ +/* $OpenBSD: tbl_term.c,v 1.27 2015/03/09 17:30:29 schwarze Exp $ */ /* * Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2011, 2012, 2014, 2015 Ingo Schwarze <schwarze@openbsd.org> @@ -64,6 +64,9 @@ 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; @@ -80,8 +83,6 @@ term_tbl(struct termp *tp, const struct tbl_span *sp) */ if (tp->tbl.cols == NULL) { - term_flushln(tp); - tp->tbl.len = term_tbl_len; tp->tbl.slen = term_tbl_strlen; tp->tbl.arg = tp; |