aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2020-01-11 20:48:18 +0000
committerIngo Schwarze <schwarze@openbsd.org>2020-01-11 20:48:18 +0000
commitac16c3edb27993fe207b50b4a00b9fa99432b0bd (patch)
treeac1f2bfe2cdcdafae9b27ba682fd9318fb8445ca
parent544fed0e7dababbce66f416055634cc091e20223 (diff)
downloadmandoc-ac16c3edb27993fe207b50b4a00b9fa99432b0bd.tar.gz
mandoc-ac16c3edb27993fe207b50b4a00b9fa99432b0bd.tar.zst
mandoc-ac16c3edb27993fe207b50b4a00b9fa99432b0bd.zip
When autogenerating one layout cell from a data cell just beyond the
last layout cell that was explicitly specified, properly initialize the spacing attribute to indicate that the default is to be used. Failing to do so and leaving the spacing at zero in this case caused misformatting when another row further down the table had even more explicitly specified cells. Bug found while trying to write regression tests for tbl_term.c rev. 1.73.
-rw-r--r--tbl_data.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/tbl_data.c b/tbl_data.c
index 9a58d325..93198484 100644
--- a/tbl_data.c
+++ b/tbl_data.c
@@ -1,4 +1,4 @@
-/* $Id: tbl_data.c,v 1.52 2019/02/09 16:00:39 schwarze Exp $ */
+/* $Id: tbl_data.c,v 1.53 2020/01/11 20:48:18 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011,2015,2017,2018,2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -21,6 +21,7 @@
#include <assert.h>
#include <ctype.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -73,6 +74,7 @@ getdata(struct tbl_node *tbl, struct tbl_span *dp,
if (dp->layout->last->col + 1 < dp->opts->cols) {
cp = mandoc_calloc(1, sizeof(*cp));
cp->pos = TBL_CELL_LEFT;
+ cp->spacing = SIZE_MAX;
dp->layout->last->next = cp;
cp->col = dp->layout->last->col + 1;
dp->layout->last = cp;