From 4c5f03bee2d18de118156e3a66459b0fd114dc31 Mon Sep 17 00:00:00 2001 From: Ingo Schwarze Date: Sat, 5 Oct 2013 22:19:10 +0000 Subject: Avoid code duplication in roff_parseln() as suggested by Christos Zoulas in NetBSD rev. 1.11; i'm even going a step further and making this yet a bit shorter. No functional change. --- roff.c | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'roff.c') diff --git a/roff.c b/roff.c index 56733186..b1302e02 100644 --- a/roff.c +++ b/roff.c @@ -712,19 +712,14 @@ roff_parseln(struct roff *r, int ln, char **bufp, assert(ROFF_IGN == e || ROFF_CONT == e); if (ROFF_CONT != e) return(e); - if (r->eqn) - return(eqn_read(&r->eqn, ln, *bufp, pos, offs)); - if (r->tbl) - return(tbl_read(r->tbl, ln, *bufp, pos)); - return(roff_parsetext(bufp, szp, pos, offs)); - } else if ( ! ctl) { - if (r->eqn) - return(eqn_read(&r->eqn, ln, *bufp, pos, offs)); + } + if (r->eqn) + return(eqn_read(&r->eqn, ln, *bufp, ppos, offs)); + if ( ! ctl) { if (r->tbl) return(tbl_read(r->tbl, ln, *bufp, pos)); return(roff_parsetext(bufp, szp, pos, offs)); - } else if (r->eqn) - return(eqn_read(&r->eqn, ln, *bufp, ppos, offs)); + } /* * If a scope is open, go to the child handler for that macro, -- cgit