diff options
author | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-18 16:34:25 +0000 |
---|---|---|
committer | Ingo Schwarze <schwarze@openbsd.org> | 2015-04-18 16:34:25 +0000 |
commit | 19dfb5cab356150bf46d159f43ead732a6a6ade5 (patch) | |
tree | 79243b72064d2dfc284d040592d6f69b6a983ad7 /demandoc.c | |
parent | 87a05fb3c50ab6e9a1befb22c6e63e3e47f571f3 (diff) | |
download | mandoc-19dfb5cab356150bf46d159f43ead732a6a6ade5.tar.gz |
Profit from the unified struct roff_man and reduce the number of
arguments of mparse_result() by one. No functional change.
Written on the ICE Bruxelles-Koeln on the way back from p2k15.
Diffstat (limited to 'demandoc.c')
-rw-r--r-- | demandoc.c | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -110,21 +110,20 @@ usage(void) static void pmandoc(struct mparse *mp, int fd, const char *fn, int list) { - struct roff_man *mdoc; struct roff_man *man; int line, col; mparse_readfd(mp, fd, fn); - mparse_result(mp, &mdoc, &man, NULL); + mparse_result(mp, &man, NULL); line = 1; col = 0; - if (mdoc) - pmdoc(mdoc_node(mdoc), &line, &col, list); - else if (man) - pman(man_node(man), &line, &col, list); - else + if (man == NULL) return; + if (man->macroset == MACROSET_MDOC) + pmdoc(mdoc_node(man), &line, &col, list); + else + pman(man_node(man), &line, &col, list); if ( ! list) putchar('\n'); |