From 6fe32c3b53980dd4c549b459bbf7efae0b6352b9 Mon Sep 17 00:00:00 2001 From: Kristaps Dzonsons Date: Sat, 1 Jan 2011 16:10:40 +0000 Subject: Raise an error if a table is closed without data. --- tbl.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'tbl.c') diff --git a/tbl.c b/tbl.c index 7407d11d..ba41a3ac 100644 --- a/tbl.c +++ b/tbl.c @@ -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 * @@ -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); } + -- cgit v1.2.3-56-ge451