From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=0.0 required=5.0 tests=UNPARSEABLE_RELAY autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 17882 invoked from network); 25 Oct 2020 18:29:05 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 25 Oct 2020 18:29:05 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id 7994b881 for ; Sun, 25 Oct 2020 13:28:59 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id fa13dbf3 for ; Sun, 25 Oct 2020 13:28:59 -0500 (EST) Date: Sun, 25 Oct 2020 13:28:59 -0500 (EST) X-Mailinglist: mandoc-source Reply-To: source@mandoc.bsd.lv MIME-Version: 1.0 From: schwarze@mandoc.bsd.lv To: source@mandoc.bsd.lv Subject: mandoc: The GNU tbl(1) program contained in the groff package internally X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <7ef673a54abb24e4@mandoc.bsd.lv> Log Message: ----------- 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. Modified Files: -------------- mandoc: tbl_term.c mandoc/regress/tbl/data: block_width.out_ascii mandoc/regress/tbl/layout: center.out_ascii spacing.out_ascii span.out_ascii mandoc/regress/tbl/mod: expand.out_ascii font.out_ascii Revision Data ------------- Index: span.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/tbl/layout/span.out_ascii,v retrieving revision 1.4 retrieving revision 1.5 diff -Lregress/tbl/layout/span.out_ascii -Lregress/tbl/layout/span.out_ascii -u -p -r1.4 -r1.5 --- regress/tbl/layout/span.out_ascii +++ regress/tbl/layout/span.out_ascii @@ -37,7 +37,7 @@ DDEESSCCRRIIPPTTIIOONN |a | b | c | d | e | +--+---+---+---+---+ leaked tab settings: - a b c d e f + a b c d e f Index: center.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/tbl/layout/center.out_ascii,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/tbl/layout/center.out_ascii -Lregress/tbl/layout/center.out_ascii -u -p -r1.3 -r1.4 --- regress/tbl/layout/center.out_ascii +++ regress/tbl/layout/center.out_ascii @@ -18,7 +18,7 @@ DDEESSCCRRIIPPTTIIOONN ***** ***** ***** leaked tab settings: - a b c de + a b c de Index: spacing.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/tbl/layout/spacing.out_ascii,v retrieving revision 1.1 retrieving revision 1.2 diff -Lregress/tbl/layout/spacing.out_ascii -Lregress/tbl/layout/spacing.out_ascii -u -p -r1.1 -r1.2 --- regress/tbl/layout/spacing.out_ascii +++ regress/tbl/layout/spacing.out_ascii @@ -32,7 +32,7 @@ DDEESSCCRRIIPPTTIIOONN |a || b | +---++---+ leaked tab settings: - a b cdef + a b c d e f Index: tbl_term.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v retrieving revision 1.73 retrieving revision 1.74 diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.73 -r1.74 --- tbl_term.c +++ tbl_term.c @@ -190,17 +190,6 @@ term_tbl(struct termp *tp, const struct 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; Index: block_width.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/tbl/data/block_width.out_ascii,v retrieving revision 1.3 retrieving revision 1.4 diff -Lregress/tbl/data/block_width.out_ascii -Lregress/tbl/data/block_width.out_ascii -u -p -r1.3 -r1.4 --- regress/tbl/data/block_width.out_ascii +++ regress/tbl/data/block_width.out_ascii @@ -61,6 +61,6 @@ DDEESSCCRRIIPPTTIIOONN | | | | | | | | 90 | +--+---+---+---+---+---+---+-----------+ leaked tab settings: - b c d e f g h + b c d e f g h OpenBSD July 4, 2017 OpenBSD Index: expand.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/expand.out_ascii,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/tbl/mod/expand.out_ascii -Lregress/tbl/mod/expand.out_ascii -u -p -r1.2 -r1.3 --- regress/tbl/mod/expand.out_ascii +++ regress/tbl/mod/expand.out_ascii @@ -97,7 +97,7 @@ DDEESSCCRRIIPPTTIIOONN x x x x x 123456789012345678901234567890123456789012 x leaked tab settings: - a b c d e f g h + a b c d e f g h Index: font.out_ascii =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/tbl/mod/font.out_ascii,v retrieving revision 1.2 retrieving revision 1.3 diff -Lregress/tbl/mod/font.out_ascii -Lregress/tbl/mod/font.out_ascii -u -p -r1.2 -r1.3 --- regress/tbl/mod/font.out_ascii +++ regress/tbl/mod/font.out_ascii @@ -15,7 +15,7 @@ DDEESSCCRRIIPPTTIIOONN | _a_n_d | so | oonn | +-------+-------+--------+ leaked tab settings: - a b c de + a b c d e -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv