summaryrefslogtreecommitdiffstats
path: root/out.c
diff options
context:
space:
mode:
Diffstat (limited to 'out.c')
-rw-r--r--out.c22
1 files changed, 17 insertions, 5 deletions
diff --git a/out.c b/out.c
index 58310d3b..289c8192 100644
--- a/out.c
+++ b/out.c
@@ -209,13 +209,25 @@ tblcalc(struct rofftbl *tbl, const struct tbl_span *sp_first,
}
/*
- * Column spacings are needed for span width calculations,
- * so set the default values now.
+ * The minimum width of columns explicitly specified
+ * in the layout is 1n.
*/
- for (icol = 0; icol <= maxcol; icol++)
- if (tbl->cols[icol].spacing == SIZE_MAX || icol == maxcol)
- tbl->cols[icol].spacing = 3;
+ if (maxcol < sp_first->opts->cols - 1)
+ maxcol = sp_first->opts->cols - 1;
+ for (icol = 0; icol <= maxcol; icol++) {
+ col = tbl->cols + icol;
+ if (col->width < 1)
+ col->width = 1;
+
+ /*
+ * Column spacings are needed for span width
+ * calculations, so set the default values now.
+ */
+
+ if (col->spacing == SIZE_MAX || icol == maxcol)
+ col->spacing = 3;
+ }
/*
* Replace the minimum widths with the missing widths,