aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/demandoc.c
diff options
context:
space:
mode:
authorIngo Schwarze <schwarze@openbsd.org>2015-04-18 16:34:25 +0000
committerIngo Schwarze <schwarze@openbsd.org>2015-04-18 16:34:25 +0000
commit70a9dbd1a5a305812354c332d729472bd2c06561 (patch)
tree063eba43441d0af27e5bfb6e4db4bd1ce0c4e545 /demandoc.c
parent90913383a1a42f4ed3816d5206553df9db14e839 (diff)
downloadmandoc-70a9dbd1a5a305812354c332d729472bd2c06561.tar.gz
mandoc-70a9dbd1a5a305812354c332d729472bd2c06561.tar.zst
mandoc-70a9dbd1a5a305812354c332d729472bd2c06561.zip
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.c15
1 files changed, 7 insertions, 8 deletions
diff --git a/demandoc.c b/demandoc.c
index 10f3d909..d4667c48 100644
--- a/demandoc.c
+++ b/demandoc.c
@@ -1,4 +1,4 @@
-/* $Id: demandoc.c,v 1.18 2015/04/18 16:06:39 schwarze Exp $ */
+/* $Id: demandoc.c,v 1.19 2015/04/18 16:34:25 schwarze Exp $ */
/*
* Copyright (c) 2011 Kristaps Dzonsons <kristaps@bsd.lv>
*
@@ -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');