aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
-rw-r--r--libroff.h4
-rw-r--r--roff.c4
-rw-r--r--tbl.c10
3 files changed, 12 insertions, 6 deletions
diff --git a/libroff.h b/libroff.h
index d6f8f92d..3c2d6a11 100644
--- a/libroff.h
+++ b/libroff.h
@@ -1,4 +1,4 @@
-/* $Id: libroff.h,v 1.12 2011/01/01 15:45:18 kristaps Exp $ */
+/* $Id: libroff.h,v 1.13 2011/01/01 16:10:40 kristaps Exp $ */
/*
* Copyright (c) 2009, 2010 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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);
diff --git a/roff.c b/roff.c
index a1c21ed2..be1dbb47 100644
--- a/roff.c
+++ b/roff.c
@@ -1,4 +1,4 @@
-/* $Id: roff.c,v 1.115 2011/01/01 15:45:18 kristaps Exp $ */
+/* $Id: roff.c,v 1.116 2011/01/01 16:10:40 kristaps Exp $ */
/*
* Copyright (c) 2010 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010 Ingo Schwarze <schwarze@openbsd.org>
@@ -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);
}
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 <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);
}
+