summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-03-06 11:03:03 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-03-06 11:03:03 +0000
commit81a8bde7e1b96fcaa41ea3eeb493fa2b628634b1 (patch)
treee679b127f31a431c3029e8040cb58d14071d3fbf
parent2479665885291314c674c00adaea2c9589d68e84 (diff)
downloadmandoc-81a8bde7e1b96fcaa41ea3eeb493fa2b628634b1.tar.gz
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@.
-rw-r--r--tbl_term.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tbl_term.c b/tbl_term.c
index f4206405..54e0303b 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -66,6 +66,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;
@@ -82,8 +85,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;