summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c5
-rw-r--r--roff.33
-rw-r--r--roff.c11
-rw-r--r--roff.h2
4 files changed, 11 insertions, 10 deletions
diff --git a/main.c b/main.c
index f437a526..bdeeac8e 100644
--- a/main.c
+++ b/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
diff --git a/roff.3 b/roff.3
index bf67671a..a43b3d81 100644
--- a/roff.3
+++ b/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 trailing newline.
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
diff --git a/roff.c b/roff.c
index b0a373cd..258de792 100644
--- a/roff.c
+++ b/roff.c
@@ -515,15 +515,20 @@ roff_parseln(struct roff *r, int ln, char **bufp,
}
-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;
+ }
}
diff --git a/roff.h b/roff.h
index 16630b0e..d90a68f7 100644
--- a/roff.h
+++ b/roff.h
@@ -37,7 +37,7 @@ struct roff *roff_alloc(struct regset *, void *, mandocmsg);
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