=================================================================== RCS file: /cvs/mandoc/out.c,v retrieving revision 1.33 retrieving revision 1.34 diff -u -p -r1.33 -r1.34 --- mandoc/out.c 2011/01/10 14:40:30 1.33 +++ mandoc/out.c 2011/01/10 15:31:00 1.34 @@ -1,4 +1,4 @@ -/* $Id: out.c,v 1.33 2011/01/10 14:40:30 kristaps Exp $ */ +/* $Id: out.c,v 1.34 2011/01/10 15:31:00 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons * @@ -464,6 +464,7 @@ tblcalc_literal(struct rofftbl *tbl, struct roffcol *c const struct tbl_dat *dp) { size_t sz, bufsz, spsz; + const char *str; /* * Calculate our width and use the spacing, with a minimum @@ -471,10 +472,12 @@ tblcalc_literal(struct rofftbl *tbl, struct roffcol *c * 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) { case (TBL_CELL_LONG): @@ -502,9 +505,9 @@ tblcalc_number(struct rofftbl *tbl, struct roffcol *co 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 *co * 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 *co /* Adjust for stipulated width. */ - if (col->width < max) - col->width = max; + if (col->width < dp->layout->spacing) + col->width = dp->layout->spacing; }