From fbc3074e5c326a84fa929c97e202c3c8466aa2ab 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 | 17 ++++++----------- 1 file changed, 6 insertions(+), 11 deletions(-) diff --git a/roff.c b/roff.c index ab7514e7..73271616 100644 --- a/roff.c +++ b/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.181 2013/10/05 22:15:03 schwarze Exp $ */ +/* $Id: roff.c,v 1.182 2013/10/05 22:19:10 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze @@ -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 v1.2.3-56-ge451