summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2020-01-11 20:48:13 +0000
committerschwarze <schwarze@openbsd.org>2020-01-11 20:48:13 +0000
commitebc37634d60b6f93c599c70ee367c0a965d344cd (patch)
tree3d70643910d4882e3db36159d97387efbb92a2c9 /usr.bin/mandoc
parentUse block mode for smbus access as required by the IPMI standard and (diff)
downloadwireguard-openbsd-ebc37634d60b6f93c599c70ee367c0a965d344cd.tar.xz
wireguard-openbsd-ebc37634d60b6f93c599c70ee367c0a965d344cd.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.61.
Diffstat (limited to 'usr.bin/mandoc')
-rw-r--r--usr.bin/mandoc/tbl_data.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/usr.bin/mandoc/tbl_data.c b/usr.bin/mandoc/tbl_data.c
index 2aeaab0e978..b2556d9b22d 100644
--- a/usr.bin/mandoc/tbl_data.c
+++ b/usr.bin/mandoc/tbl_data.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: tbl_data.c,v 1.39 2019/02/09 16:00:06 schwarze Exp $ */
+/* $OpenBSD: tbl_data.c,v 1.40 2020/01/11 20:48:13 schwarze Exp $ */
/*
* Copyright (c) 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2011,2015,2017,2018,2019 Ingo Schwarze <schwarze@openbsd.org>
@@ -19,6 +19,7 @@
#include <assert.h>
#include <ctype.h>
+#include <stdint.h>
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
@@ -71,6 +72,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;