diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2013-10-05 22:19:10 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2013-10-05 22:19:10 +0000 |
commit | 4c5f03bee2d18de118156e3a66459b0fd114dc31 (patch) | |
tree | 4c25334461a27fb1c5d73c5ade6a5bbb61d28bdb /roff.c | |
parent | 59ceaaf6aa64f56ccc82a1659d6fe75139c26c22 (diff) | |
download | mandoc-4c5f03bee2d18de118156e3a66459b0fd114dc31.tar.gz |
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.
Diffstat (limited to 'roff.c')
-rw-r--r-- | roff.c | 15 |
1 files changed, 5 insertions, 10 deletions
@@ -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, |