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 11821 invoked from network); 26 Apr 2022 14:52:09 -0000 Received: from bsd.lv (HELO mandoc.bsd.lv) (66.111.2.12) by inbox.vuxu.org with ESMTPUTF8; 26 Apr 2022 14:52:09 -0000 Received: from fantadrom.bsd.lv (localhost [127.0.0.1]) by mandoc.bsd.lv (OpenSMTPD) with ESMTP id c16cded9 for ; Tue, 26 Apr 2022 09:52:07 -0500 (EST) Received: from localhost (mandoc.bsd.lv [local]) by mandoc.bsd.lv (OpenSMTPD) with ESMTPA id 1d96531f for ; Tue, 26 Apr 2022 09:52:07 -0500 (EST) Date: Tue, 26 Apr 2022 09:52:07 -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: At the end of every tbl(7) cell, clear the \z state. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Message-ID: <336517ce6e0a4165@mandoc.bsd.lv> Log Message: ----------- At the end of every tbl(7) cell, clear the \z state. This is needed because the TERMP_MULTICOL mode is designed such that term_tbl() buffers all the cells of the table row before the normal reset logic near the end of term_flushln() can be reached. This fixes an assertion failure triggered by \z near the end of a table cell, found by tb@ using afl(1). Modified Files: -------------- mandoc: tbl_term.c mandoc/regress/tbl/data: Makefile Added Files: ----------- mandoc/regress/tbl/data: escz.in escz.out_ascii escz_end.in escz_end.out_ascii Revision Data ------------- Index: tbl_term.c =================================================================== RCS file: /home/cvs/mandoc/mandoc/tbl_term.c,v retrieving revision 1.77 retrieving revision 1.78 diff -Ltbl_term.c -Ltbl_term.c -u -p -r1.77 -r1.78 --- tbl_term.c +++ tbl_term.c @@ -1,6 +1,6 @@ /* $Id$ */ /* - * Copyright (c) 2011-2021 Ingo Schwarze + * Copyright (c) 2011-2022 Ingo Schwarze * Copyright (c) 2009, 2011 Kristaps Dzonsons * * Permission to use, copy, modify, and distribute this software for any @@ -293,6 +293,7 @@ term_tbl(struct termp *tp, const struct } tp->tcol++; tp->col = 0; + tp->flags &= ~(TERMP_BACKAFTER | TERMP_BACKBEFORE); tbl_data(tp, sp->opts, cp, dp, tp->tbl.cols + ic); if (dp != NULL && (ic || sp->layout->first->pos != TBL_CELL_SPAN)) { --- /dev/null +++ regress/tbl/data/escz_end.in @@ -0,0 +1,14 @@ +.\" $OpenBSD: escz_end.in,v 1.1 2022/04/26 14:46:30 schwarze Exp $ +.TH TBL-DATA-ESCZ_END 1 "April 26, 2022" +.SH NAME +tbl-data-escz_end \- z escape sequence at the end of a tbl(7) cell +.SH DESCRIPTION +initial text +.TS +tab(:); +LLL. +a:b:c +d\z:e:f +.TE +.sp +final text Index: Makefile =================================================================== RCS file: /home/cvs/mandoc/mandoc/regress/tbl/data/Makefile,v retrieving revision 1.5 retrieving revision 1.6 diff -Lregress/tbl/data/Makefile -Lregress/tbl/data/Makefile -u -p -r1.5 -r1.6 --- regress/tbl/data/Makefile +++ regress/tbl/data/Makefile @@ -1,13 +1,16 @@ -# $OpenBSD: Makefile,v 1.5 2019/07/18 14:38:47 schwarze Exp $ +# $OpenBSD: Makefile,v 1.6 2022/04/26 14:46:30 schwarze Exp $ REGRESS_TARGETS = blankline block_empty block_unclosed block_width -REGRESS_TARGETS += block_wrap empty insert +REGRESS_TARGETS += block_wrap empty escz escz_end insert LINT_TARGETS = block_unclosed empty insert -# groff-1.22.3 defect: +# groff-1.23.0 defects: # - When a table ends in the middle of a block, # GNU eqn produces no output whatsoever for the whole table. +# - When a table cell ends with a no-advance escape sequence, +# the next cell is appended to the current cell instead of +# aligning it to the next column. -SKIP_GROFF = block_unclosed +SKIP_GROFF = block_unclosed escz_end .include --- /dev/null +++ regress/tbl/data/escz.out_ascii @@ -0,0 +1,14 @@ +TBL-DATA-ESCZ(1) General Commands Manual TBL-DATA-ESCZ(1) + +NNAAMMEE + tbl-data-escz - non-advancing glyph at the end of a tbl(7) cell + +DDEESSCCRRIIPPTTIIOONN + initial text + + a b + cd e + + final text + +OpenBSD April 26, 2022 TBL-DATA-ESCZ(1) --- /dev/null +++ regress/tbl/data/escz_end.out_ascii @@ -0,0 +1,14 @@ +TBL-DATA-ESCZ_END(1) General Commands Manual TBL-DATA-ESCZ_END(1) + +NNAAMMEE + tbl-data-escz_end - z escape sequence at the end of a tbl(7) cell + +DDEESSCCRRIIPPTTIIOONN + initial text + + a b c + d e f + + final text + +OpenBSD April 26, 2022 TBL-DATA-ESCZ_END(1) --- /dev/null +++ regress/tbl/data/escz.in @@ -0,0 +1,14 @@ +.\" $OpenBSD: escz.in,v 1.1 2022/04/26 14:46:30 schwarze Exp $ +.TH TBL-DATA-ESCZ 1 "April 26, 2022" +.SH NAME +tbl-data-escz \- non-advancing glyph at the end of a tbl(7) cell +.SH DESCRIPTION +initial text +.TS +tab(:); +LL. +a:b +c\zd:e +.TE +.sp +final text -- To unsubscribe send an email to source+unsubscribe@mandoc.bsd.lv