source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: Raise an error if a table is closed without data.
@ 2011-01-01 16:10 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-01-01 16:10 UTC (permalink / raw)
  To: source

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2011-01-01 16:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-01-01 16:10 mdocml: Raise an error if a table is closed without data kristaps

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).