diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 16:10:40 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-01-01 16:10:40 +0000 |
commit | 6fe32c3b53980dd4c549b459bbf7efae0b6352b9 (patch) | |
tree | 0513dcebbcda433b32256d39923b9b24bb7bfe40 /tbl.c | |
parent | 52a50fec0924869c52803daed1f1d5dbf5f108af (diff) | |
download | mandoc-6fe32c3b53980dd4c549b459bbf7efae0b6352b9.tar.gz mandoc-6fe32c3b53980dd4c549b459bbf7efae0b6352b9.tar.zst mandoc-6fe32c3b53980dd4c549b459bbf7efae0b6352b9.zip |
Raise an error if a table is closed without data.
Diffstat (limited to 'tbl.c')
-rw-r--r-- | tbl.c | 10 |
1 files changed, 8 insertions, 2 deletions
@@ -1,4 +1,4 @@ -/* $Id: tbl.c,v 1.13 2011/01/01 15:45:18 kristaps Exp $ */ +/* $Id: tbl.c,v 1.14 2011/01/01 16:10:40 kristaps Exp $ */ /* * Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv> * @@ -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); } + |