aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/main.c
diff options
context:
space:
mode:
authorKristaps Dzonsons <kristaps@bsd.lv>2011-02-09 09:33:43 +0000
committerKristaps Dzonsons <kristaps@bsd.lv>2011-02-09 09:33:43 +0000
commita1933d3c64fdd2f70b36e98de723f84692e136b1 (patch)
treea607c201fb80372c66bd3d6525ac0796d4bd538f /main.c
parentdfc3c322d2d9553a0f7c08a28a772b13beec5e7f (diff)
downloadmandoc-a1933d3c64fdd2f70b36e98de723f84692e136b1.tar.gz
mandoc-a1933d3c64fdd2f70b36e98de723f84692e136b1.tar.zst
mandoc-a1933d3c64fdd2f70b36e98de723f84692e136b1.zip
Consolidate "rc" value in main.c around addspan, addeqn, and parseln.
Diffstat (limited to 'main.c')
-rw-r--r--main.c28
1 files changed, 14 insertions, 14 deletions
diff --git a/main.c b/main.c
index b11ad041..f369dc1b 100644
--- a/main.c
+++ b/main.c
@@ -1,4 +1,4 @@
-/* $Id: main.c,v 1.145 2011/02/09 09:18:15 kristaps Exp $ */
+/* $Id: main.c,v 1.146 2011/02/09 09:33:43 kristaps Exp $ */
/*
* Copyright (c) 2008, 2009, 2010, 2011 Kristaps Dzonsons <kristaps@bsd.lv>
* Copyright (c) 2010, 2011 Ingo Schwarze <schwarze@openbsd.org>
@@ -853,35 +853,35 @@ rerun:
* currently open parse. Since we only get here if
* there does exist data (see tbl_data.c), we're
* guaranteed that something's been allocated.
+ * Do the same for ROFF_EQN.
*/
- if (ROFF_TBL == rr) {
- assert(curp->man || curp->mdoc);
+ rc = -1;
+
+ if (ROFF_TBL == rr)
while (NULL != (span = roff_span(curp->roff))) {
- if (curp->man)
- man_addspan(curp->man, span);
- else
+ rc = curp->man ?
+ man_addspan(curp->man, span) :
mdoc_addspan(curp->mdoc, span);
+ if (0 == rc)
+ break;
}
- } else if (ROFF_EQN == rr) {
- assert(curp->man || curp->mdoc);
- assert(roff_eqn(curp->roff));
+ else if (ROFF_EQN == rr)
rc = curp->mdoc ?
mdoc_addeqn(curp->mdoc,
roff_eqn(curp->roff)) :
man_addeqn(curp->man,
roff_eqn(curp->roff));
- } else if (curp->man || curp->mdoc) {
+ else if (curp->man || curp->mdoc)
rc = curp->man ?
man_parseln(curp->man,
curp->line, ln.buf, of) :
mdoc_parseln(curp->mdoc,
curp->line, ln.buf, of);
- if ( ! rc) {
- assert(MANDOCLEVEL_FATAL <= file_status);
- break;
- }
+ if (0 == rc) {
+ assert(MANDOCLEVEL_FATAL <= file_status);
+ break;
}
/* Temporary buffers typically are not full. */