X-Git-Url: https://git.distorted.org.uk/~mdw/sgt/halibut/blobdiff_plain/0ec6a4292ed4ccc4c3c3c24fe9402621066b8c10..refs/heads/master:/bk_man.c diff --git a/bk_man.c b/bk_man.c index dce77d4..44f159f 100644 --- a/bk_man.c +++ b/bk_man.c @@ -235,9 +235,12 @@ void man_backend(paragraph *sourceform, keywordlist *keywords, /* * Open the output file. */ - fp = fopen(conf.filename, "w"); + if (!strcmp(conf.filename, "-")) + fp = stdout; + else + fp = fopen(conf.filename, "w"); if (!fp) { - error(err_cantopenw, conf.filename); + err_cantopenw(conf.filename); return; } @@ -425,7 +428,8 @@ void man_backend(paragraph *sourceform, keywordlist *keywords, /* * Tidy up. */ - fclose(fp); + if (fp != stdout) + fclose(fp); man_conf_cleanup(conf); }