aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/tbl_term.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2022-04-26 14:52:05 +0000
committerIngo Schwarze <schwarze@openbsd.org>2022-04-26 14:52:05 +0000
commitc2e70e08c4a052a976c913961c21ebe72ab8111e (patch)
treec077eaa18e4190d474428ba1049d0d27350101bf /tbl_term.c
parent8c8298198d4578f2d09c34f5b09dea2af3a45a19 (diff)
downloadmandoc-c2e70e08c4a052a976c913961c21ebe72ab8111e.tar.gz
mandoc-c2e70e08c4a052a976c913961c21ebe72ab8111e.tar.zst
mandoc-c2e70e08c4a052a976c913961c21ebe72ab8111e.zip
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).
Diffstat (limited to 'tbl_term.c')
-rw-r--r--tbl_term.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/tbl_term.c b/tbl_term.c
index ac826a5c..a34d1335 100644
--- a/tbl_term.c
+++ b/tbl_term.c
@@ -1,6 +1,6 @@
-/* $Id: tbl_term.c,v 1.77 2022/04/14 16:43:44 schwarze Exp $ */
+/* $Id: tbl_term.c,v 1.78 2022/04/26 14:52:05 schwarze Exp $ */
/*
- * Copyright (c) 2011-2021 Ingo Schwarze <schwarze@openbsd.org>
+ * Copyright (c) 2011-2022 Ingo Schwarze <schwarze@openbsd.org>
* Copyright (c) 2009, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
* Permission to use, copy, modify, and distribute this software for any
@@ -293,6 +293,7 @@ term_tbl(struct termp *tp, const struct tbl_span *sp)
}
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)) {