diff options
author | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-10-06 22:29:12 +0000 |
---|---|---|
committer | Kristaps Dzonsons <kristaps@bsd.lv> | 2011-10-06 22:29:12 +0000 |
commit | 2835b2c808e87f26f06bd8ec3a2c581923777902 (patch) | |
tree | 4ecad31be3626da3f4f731014abab81403337a9a /main.c | |
parent | 6f9df825574a6b5616f7b42b6687a5b608cc8717 (diff) | |
download | mandoc-2835b2c808e87f26f06bd8ec3a2c581923777902.tar.gz |
If -Tman is specified and input is -man, echo the preprocessed (`so'
replaced by file) input. This replaces earlier behaviour of doing
nothing, which I found unexpected (mandoc should always output).
This requires a buffer in read.c that saves the input lines before being
parsed, with a special hook if `so' is invoked. This buffer is just
flushed to output if -mman is the input.
While mucking around doing this, I also alpha-ordered the mandoc.h
functions.
Ok schwarze@, with no screaming when the polished patch was published.
Diffstat (limited to 'main.c')
-rw-r--r-- | main.c | 7 |
1 files changed, 7 insertions, 0 deletions
@@ -127,6 +127,12 @@ main(int argc, char *argv[]) curp.mp = mparse_alloc(type, curp.wlevel, mmsg, &curp); + /* + * Conditionally start up the lookaside buffer before parsing. + */ + if (OUTT_MAN == curp.outtype) + mparse_keep(curp.mp); + argc -= optind; argv += optind; @@ -252,6 +258,7 @@ parse(struct curparse *curp, int fd, break; case (OUTT_MAN): curp->outmdoc = man_mdoc; + curp->outman = man_man; break; case (OUTT_PDF): /* FALLTHROUGH */ |