From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from krisdoz.my.domain (kristaps@localhost [127.0.0.1]) by krisdoz.my.domain (8.14.3/8.14.3) with ESMTP id p01GAfd4031419 for ; Sat, 1 Jan 2011 11:10:41 -0500 (EST) Received: (from kristaps@localhost) by krisdoz.my.domain (8.14.3/8.14.3/Submit) id p01GAei7031578; Sat, 1 Jan 2011 11:10:40 -0500 (EST) Date: Sat, 1 Jan 2011 11:10:40 -0500 (EST) Message-Id: <201101011610.p01GAei7031578@krisdoz.my.domain> X-Mailinglist: mdocml-source Reply-To: source@mdocml.bsd.lv MIME-Version: 1.0 From: kristaps@mdocml.bsd.lv To: source@mdocml.bsd.lv Subject: mdocml: Raise an error if a table is closed without data. X-Mailer: activitymail 1.26, http://search.cpan.org/dist/activitymail/ Content-Type: text/plain; charset=utf-8 Log Message: ----------- Raise an error if a table is closed without data. Modified Files: -------------- mdocml: libroff.h roff.c tbl.c Revision Data ------------- Index: tbl.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/tbl.c,v retrieving revision 1.13 retrieving revision 1.14 diff -Ltbl.c -Ltbl.c -u -p -r1.13 -r1.14 --- tbl.c +++ tbl.c @@ -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); } + Index: roff.c =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v retrieving revision 1.115 retrieving revision 1.116 diff -Lroff.c -Lroff.c -u -p -r1.115 -r1.116 --- roff.c +++ roff.c @@ -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); } Index: libroff.h =================================================================== RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/libroff.h,v retrieving revision 1.12 retrieving revision 1.13 diff -Llibroff.h -Llibroff.h -u -p -r1.12 -r1.13 --- libroff.h +++ libroff.h @@ -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); -- To unsubscribe send an email to source+unsubscribe@mdocml.bsd.lv