aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tbl_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-10-25 18:28:23 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-10-25 18:28:23 +0000
commit15feebaabfcad331c67405bbe09197c6c1503bce (patch)
treee3d8187d892720eebbf4458de08e9ea14a55fa3f /tbl_term.c
parentdc7248813739f10e087a87325e7aca75a5630c16 (diff)
downloadmandoc-15feebaabfcad331c67405bbe09197c6c1503bce.tar.gz
mandoc-15feebaabfcad331c67405bbe09197c6c1503bce.tar.zst
mandoc-15feebaabfcad331c67405bbe09197c6c1503bce.zip
The GNU tbl(1) program contained in the groff package internally
uses roff(7) tabulator settings to implement tables, and it used to leak the changed tabulator settings from tables to the subsequent roff(7) code. In mandoc/tbl_term.c rev. 1.54 (June 17, 2017), code was added to be bug-compatible with groff. In commit d0e03cf6 (Oct 20, 2020), GNU tbl(1) changed behaviour to save the tabulator settings before starting a table and restore them afterwards. Adjust mandoc for compatibility. Since mandoc implements tables without using roff(7) tabulator settings, saving and restoring tabulator settings is not needed in mandoc. Simply deleting the code that changed tabulator settings by reverting tbl_term.c rev. 1.54 is sufficient in mandoc. Also adjust the desired output of the regression tests to match the new behaviour of both groff and mandoc.
Diffstat (limited to 'tbl_term.c')
-rw-r--r--tbl_term.c13
1 files changed, 1 insertions, 12 deletions
diff --git a/tbl_term.c b/tbl_term.c
index b124d2c0..476d182e 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_term.c,v 1.73 2020/01/11 16:26:08 schwarze Exp $ */
+/* $Id: tbl_term.c,v 1.74 2020/10/25 18:28:23 schwarze Exp $ */
/*
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011-2020 Ingo Schwarze <schwarze@openbsd.org>
@@ -190,17 +190,6 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
tblcalc(&tp->tbl, sp, tp->tcol->offset, tp->tcol->rmargin);
- /* Tables leak .ta settings to subsequent text. */
-
- term_tab_set(tp, NULL);
- coloff = sp->opts->opts & (TBL_OPT_BOX | TBL_OPT_DBOX) ||
- sp->opts->lvert;
- for (ic = 0; ic < sp->opts->cols; ic++) {
- coloff += tp->tbl.cols[ic].width;
- term_tab_iset(coloff);
- coloff += tp->tbl.cols[ic].spacing;
- }
-
/* Center the table as a whole. */
offset = tp->tcol->offset;