diff options
author | 2013-10-03 22:50:02 +0000 | |
---|---|---|
committer | 2013-10-03 22:50:02 +0000 | |
commit | c6e29dee5fe4c9fc992e3186d10a138e0c06e9ac (patch) | |
tree | 6680dcddd6accbd3774ea167c1399f5f18015c2b | |
parent | Expand references to number registers in exactly the same way as (diff) | |
download | wireguard-openbsd-c6e29dee5fe4c9fc992e3186d10a138e0c06e9ac.tar.xz wireguard-openbsd-c6e29dee5fe4c9fc992e3186d10a138e0c06e9ac.zip |
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.
-rw-r--r-- | usr.bin/mandoc/roff.c | 17 |
1 files changed, 6 insertions, 11 deletions
diff --git a/usr.bin/mandoc/roff.c b/usr.bin/mandoc/roff.c index bea0af0f2a9..5f4c5155adc 100644 --- a/usr.bin/mandoc/roff.c +++ b/usr.bin/mandoc/roff.c @@ -1,4 +1,4 @@ -/* $Id: roff.c,v 1.53 2013/10/03 22:04:08 schwarze Exp $ */ +/* $Id: roff.c,v 1.54 2013/10/03 22:50:02 schwarze Exp $ */ /* * Copyright (c) 2010, 2011, 2012 Kristaps Dzonsons <kristaps@bsd.lv> * Copyright (c) 2010, 2011, 2012, 2013 Ingo Schwarze <schwarze@openbsd.org> @@ -708,19 +708,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, |