diff options
Diffstat (limited to 'out.c')
-rw-r--r-- | out.c | 23 |
1 files changed, 13 insertions, 10 deletions
@@ -464,6 +464,7 @@ tblcalc_literal(struct rofftbl *tbl, struct roffcol *col, const struct tbl_dat *dp) { size_t sz, bufsz, spsz; + const char *str; /* * Calculate our width and use the spacing, with a minimum @@ -471,9 +472,11 @@ tblcalc_literal(struct rofftbl *tbl, struct roffcol *col, * either side, while right/left get a single adjacent space). */ - sz = bufsz = spsz = 0; - if (dp->string) - sz = (*tbl->slen)(dp->string, tbl->arg); + bufsz = spsz = 0; + str = dp->string ? dp->string : ""; + sz = (*tbl->slen)(str, tbl->arg); + + /* FIXME: TBL_DATA_HORIZ et al.? */ assert(dp->layout); switch (dp->layout->pos) { @@ -502,9 +505,9 @@ tblcalc_number(struct rofftbl *tbl, struct roffcol *col, const struct tbl *tp, const struct tbl_dat *dp) { int i; - size_t sz, psz, ssz, d, max; - char *cp; + size_t sz, psz, ssz, d; const char *str; + char *cp; char buf[2]; /* @@ -516,11 +519,11 @@ tblcalc_number(struct rofftbl *tbl, struct roffcol *col, * Finally, re-assign the stored values. */ - str = dp && dp->string ? dp->string : ""; - max = dp && dp->layout ? dp->layout->spacing : 0; - + str = dp->string ? dp->string : ""; sz = (*tbl->slen)(str, tbl->arg); + /* FIXME: TBL_DATA_HORIZ et al.? */ + buf[0] = tp->decimal; buf[1] = '\0'; @@ -556,8 +559,8 @@ tblcalc_number(struct rofftbl *tbl, struct roffcol *col, /* Adjust for stipulated width. */ - if (col->width < max) - col->width = max; + if (col->width < dp->layout->spacing) + col->width = dp->layout->spacing; } |