diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-02-09 09:33:43 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-02-09 09:33:43 +0000 |
commit | f6b21f845c28c5c32c6abed3c8a192e58cd35fb0 (patch) | |
tree | ed376fea89cf236288be1bce5e8ef1f738a672cf | |
parent | 75f227792a0d34031aeeaec473483f07aa7c793c (diff) | |
download | mandoc-f6b21f845c28c5c32c6abed3c8a192e58cd35fb0.tar.gz |
Consolidate "rc" value in main.c around addspan, addeqn, and parseln.
-rw-r--r-- | main.c | 26 |
1 files changed, 13 insertions, 13 deletions
@@ -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. */ |