=================================================================== RCS file: /cvs/mandoc/read.c,v retrieving revision 1.150.2.5 retrieving revision 1.150.2.7 diff -u -p -r1.150.2.5 -r1.150.2.7 --- mandoc/read.c 2017/01/09 02:25:53 1.150.2.5 +++ mandoc/read.c 2017/02/03 18:22:30 1.150.2.7 @@ -1,4 +1,4 @@ -/* $Id: read.c,v 1.150.2.5 2017/01/09 02:25:53 schwarze Exp $ */ +/* $Id: read.c,v 1.150.2.7 2017/02/03 18:22:30 schwarze Exp $ */ /* * Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons * Copyright (c) 2010-2017 Ingo Schwarze @@ -50,8 +50,8 @@ #define REPARSE_LIMIT 1000 struct mparse { - struct roff_man *man; /* man parser */ struct roff *roff; /* roff parser (!NULL) */ + struct roff_man *man; /* man parser */ char *sodest; /* filename pointed to by .so */ const char *file; /* filename of current input file */ struct buf *primary; /* buffer currently being parsed */ @@ -179,6 +179,7 @@ static const char * const mandocerrs[MANDOCERR_MAX] = "blank line in fill mode, using .sp", "tab in filled text", "whitespace at end of input line", + "new sentence, new line", "bad comment style", "invalid escape sequence", "undefined string, using \"\"", @@ -835,13 +836,15 @@ mparse_reset(struct mparse *curp) { roff_reset(curp->roff); roff_man_reset(curp->man); + + free(curp->sodest); + curp->sodest = NULL; + if (curp->secondary) curp->secondary->sz = 0; curp->file_status = MANDOCLEVEL_OK; - - free(curp->sodest); - curp->sodest = NULL; + curp->gzip = 0; } void @@ -849,8 +852,7 @@ mparse_free(struct mparse *curp) { roff_man_free(curp->man); - if (curp->roff) - roff_free(curp->roff); + roff_free(curp->roff); if (curp->secondary) free(curp->secondary->buf);