/*
* 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);
return;
/*
* Tidy up.
*/
- fclose(fp);
+ if (fp != stdout)
+ fclose(fp);
man_conf_cleanup(conf);
}