diff options
-rw-r--r-- | libroff.h | 2 | ||||
-rw-r--r-- | roff.c | 2 | ||||
-rw-r--r-- | tbl.c | 8 |
3 files changed, 9 insertions, 3 deletions
@@ -54,7 +54,7 @@ struct tbl { (*(tblp)->msg)((type), (tblp)->data, (line), (col), NULL) struct tbl *tbl_alloc(int, int, void *, mandocmsg); -void tbl_restart(struct tbl *); +void tbl_restart(int, int, struct tbl *); void tbl_free(struct tbl *); void tbl_reset(struct tbl *); enum rofferr tbl_read(struct tbl *, int, const char *, int); @@ -1138,7 +1138,7 @@ roff_T_(ROFF_ARGS) if (NULL == r->tbl) (*r->msg)(MANDOCERR_NOSCOPE, r->data, ln, ppos, NULL); else - tbl_restart(r->tbl); + tbl_restart(ppos, ln, r->tbl); return(ROFF_IGN); } @@ -116,10 +116,15 @@ tbl_free(struct tbl *p) } void -tbl_restart(struct tbl *tbl) +tbl_restart(int line, int pos, struct tbl *tbl) { tbl->part = TBL_PART_LAYOUT; + tbl->line = line; + tbl->pos = pos; + + if (NULL == tbl->first_span || NULL == tbl->first_span->first) + TBL_MSG(tbl, MANDOCERR_TBLNODATA, tbl->line, tbl->pos); } const struct tbl_span * @@ -137,3 +142,4 @@ tbl_end(struct tbl *tbl) if (NULL == tbl->first_span || NULL == tbl->first_span->first) TBL_MSG(tbl, MANDOCERR_TBLNODATA, tbl->line, tbl->pos); } + |