source@mandoc.bsd.lv
 help / color / mirror / Atom feed
* mdocml: More checks for proper table exit.
@ 2011-01-01 16:18 kristaps
  0 siblings, 0 replies; only message in thread
From: kristaps @ 2011-01-01 16:18 UTC (permalink / raw)
  To: source

Log Message:
-----------
More checks for proper table exit.

Modified Files:
--------------
    mdocml:
        main.c
        roff.3
        roff.c
        roff.h

Revision Data
-------------
Index: roff.3
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.3,v
retrieving revision 1.9
retrieving revision 1.10
diff -Lroff.3 -Lroff.3 -u -p -r1.9 -r1.10
--- roff.3
+++ roff.3
@@ -35,7 +35,7 @@
 .Fa "void *data"
 .Fa "mandocmsg msgs"
 .Fc
-.Ft int
+.Ft void
 .Fn roff_endparse "struct roff *roff"
 .Ft void
 .Fn roff_free "struct roff *roff"
@@ -141,7 +141,6 @@ This line should not contain the trailin
 Returns 0 on failure, 1 on success.
 .It Fn roff_endparse
 Signals that the parse is complete.
-Returns 0 on failure, 1 on success.
 .It Fn roff_span
 If
 .Fn roff_parseln
Index: roff.h
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.h,v
retrieving revision 1.21
retrieving revision 1.22
diff -Lroff.h -Lroff.h -u -p -r1.21 -r1.22
--- roff.h
+++ roff.h
@@ -37,7 +37,7 @@ struct	roff	 *roff_alloc(struct regset *
 void		  roff_reset(struct roff *);
 enum	rofferr	  roff_parseln(struct roff *, int, 
 			char **, size_t *, int, int *);
-int		  roff_endparse(struct roff *);
+void		  roff_endparse(struct roff *);
 const struct tbl_span *roff_span(const struct roff *);
 
 __END_DECLS
Index: roff.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/roff.c,v
retrieving revision 1.116
retrieving revision 1.117
diff -Lroff.c -Lroff.c -u -p -r1.116 -r1.117
--- roff.c
+++ roff.c
@@ -515,15 +515,20 @@ roff_parseln(struct roff *r, int ln, cha
 }
 
 
-int
+void
 roff_endparse(struct roff *r)
 {
 
-	/* FIXME: if r->tbl */
 	if (r->last)
 		(*r->msg)(MANDOCERR_SCOPEEXIT, r->data, 
 				r->last->line, r->last->col, NULL);
-	return(1);
+
+	if (r->tbl) {
+		(*r->msg)(MANDOCERR_SCOPEEXIT, r->data, 
+				r->tbl->line, r->tbl->pos, NULL);
+		tbl_end(r->tbl);
+		r->tbl = NULL;
+	}
 }
 
 
Index: main.c
===================================================================
RCS file: /usr/vhosts/mdocml.bsd.lv/cvs/mdocml/main.c,v
retrieving revision 1.129
retrieving revision 1.130
diff -Lmain.c -Lmain.c -u -p -r1.129 -r1.130
--- main.c
+++ main.c
@@ -527,10 +527,7 @@ fdesc(struct curparse *curp)
 	}
 
 	assert(curp->roff);
-	if ( ! roff_endparse(curp->roff)) {
-		assert(MANDOCLEVEL_FATAL <= file_status);
-		goto cleanup;
-	}
+	roff_endparse(curp->roff);
 
 	/*
 	 * With -Wstop and warnings or errors of at least
--
 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:18 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:18 mdocml: More checks for proper table exit 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).