summaryrefslogtreecommitdiff
path: root/usr.bin/mandoc/roff.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@cvs.openbsd.org>2013-10-03 22:50:03 +0000
committerIngo Schwarze <schwarze@cvs.openbsd.org>2013-10-03 22:50:03 +0000
commit985bccd4b9aa40dd39bf5ca26749485c9756db10 (patch)
treeaeae0a71815192dbaa764bf8921d3533b55dc52c /usr.bin/mandoc/roff.c
parente1446015d944bb929bb46a2ce3d92fb221f77cad (diff)
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 'usr.bin/mandoc/roff.c')
-rw-r--r--usr.bin/mandoc/roff.c17
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,