From 41c83570cd0b176c663b583e5990f9869f214754 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Thu, 13 Dec 2018 03:40:13 +0000 Subject: 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. --- roff.c | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) (limited to 'roff.c') diff --git a/roff.c b/roff.c index d7b24d61..283f3997 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.346 2018/12/13 02:06:07 schwarze Exp $ */ +/* $Id: roff.c,v 1.347 2018/12/13 03:40:13 schwarze Exp $ */ /* * Copyright (c) 2008-2012, 2014 Kristaps Dzonsons * Copyright (c) 2010-2015, 2017, 2018 Ingo Schwarze @@ -34,8 +34,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 @@ -723,8 +723,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) @@ -1079,8 +1078,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); } -- cgit v1.2.3