summaryrefslogtreecommitdiffstats
path: root/usr.bin/mandoc/roff.c
diff options
context:
space:
mode:
authorschwarze <schwarze@openbsd.org>2018-12-13 03:40:09 +0000
committerschwarze <schwarze@openbsd.org>2018-12-13 03:40:09 +0000
commitabe31b566ef1374e9341674d814b02bdec3c7e65 (patch)
tree2b6d9fd1050172fe4ee1acd68ccb67688c12ce2a /usr.bin/mandoc/roff.c
parentCleanup, no functional change: (diff)
downloadwireguard-openbsd-abe31b566ef1374e9341674d814b02bdec3c7e65.tar.xz
wireguard-openbsd-abe31b566ef1374e9341674d814b02bdec3c7e65.zip
Cleanup, no functional change:
In libroff.h, nothing was left except the eqn(7) parser interface, which isn't really part of the roff(7) parser, so rename it to eqn_parse.h. While here, move struct eqn_def to eqn.c because that's the only file using it, and let eqn_box_free() and eqn_free() handle NULL.
Diffstat (limited to 'usr.bin/mandoc/roff.c')
-rw-r--r--usr.bin/mandoc/roff.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c
index 1b0bf0b9687..a1767789ecc 100644
--- a/usr.bin/mandoc/roff.c
+++ b/usr.bin/mandoc/roff.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: roff.c,v 1.218 2018/12/13 02:05:57 schwarze Exp $ */
+/* $OpenBSD: roff.c,v 1.219 2018/12/13 03:40:09 schwarze Exp $ */
/*
* Copyright (c) 2008-2012, 2014 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze <schwarze@openbsd.org>
@@ -32,8 +32,8 @@
#include "roff.h"
#include "libmandoc.h"
#include "roff_int.h"
-#include "libroff.h"
#include "tbl_parse.h"
+#include "eqn_parse.h"
/* Maximum number of string expansions per line, to break infinite loops. */
#define EXPAND_LIMIT 1000
@@ -721,8 +721,7 @@ roff_free1(struct roff *r)
tbl_free(r->first_tbl);
r->first_tbl = r->last_tbl = r->tbl = NULL;
- if (r->last_eqn != NULL)
- eqn_free(r->last_eqn);
+ eqn_free(r->last_eqn);
r->last_eqn = r->eqn = NULL;
while (r->mstackpos >= 0)
@@ -1077,8 +1076,7 @@ roff_node_free(struct roff_node *n)
mdoc_argv_free(n->args);
if (n->type == ROFFT_BLOCK || n->type == ROFFT_ELEM)
free(n->norm);
- if (n->eqn != NULL)
- eqn_box_free(n->eqn);
+ eqn_box_free(n->eqn);
free(n->string);
free(n);
}