diff options
-rw-r--r-- | main.c | 5 | ||||
-rw-r--r-- | roff.3 | 3 | ||||
-rw-r--r-- | roff.c | 11 | ||||
-rw-r--r-- | roff.h | 2 |
4 files changed, 11 insertions, 10 deletions
@@ -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 @@ -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 @@ -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; + } } @@ -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 |