summaryrefslogtreecommitdiffstats
path: root/read.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2017-02-03 18:22:30 +0000
committerIngo Schwarze <schwarze@openbsd.org>2017-02-03 18:22:30 +0000
commitdfbf15c7ba73c2e30cbd57915e45ba931c9ea3f5 (patch)
treefd02ea6bb594203c532f9328229da42cf1c0fa14 /read.c
parent51560b357b0fdc69a65d07435d8438db06686330 (diff)
downloadmandoc-dfbf15c7ba73c2e30cbd57915e45ba931c9ea3f5.tar.gz
merge rev.s 1.159 and 1.160: gzip bugfix and struct mparse cleanup
Diffstat (limited to 'read.c')
-rw-r--r--read.c13
1 files changed, 7 insertions, 6 deletions
diff --git a/read.c b/read.c
index 8344ae62..dc66198d 100644
--- a/read.c
+++ b/read.c
@@ -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 */
@@ -836,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
@@ -850,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);