~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Revamp of the Halibut error handling mechanism.
[sgt/halibut]
/
bk_man.c
diff --git
a/bk_man.c
b/bk_man.c
index
dce77d4
..
44f159f
100644
(file)
--- a/
bk_man.c
+++ b/
bk_man.c
@@
-235,9
+235,12
@@
void man_backend(paragraph *sourceform, keywordlist *keywords,
/*
* Open the output file.
*/
/*
* Open the output file.
*/
- fp = fopen(conf.filename, "w");
+ if (!strcmp(conf.filename, "-"))
+ fp = stdout;
+ else
+ fp = fopen(conf.filename, "w");
if (!fp) {
if (!fp) {
- err
or(err_cantopenw,
conf.filename);
+ err
_cantopenw(
conf.filename);
return;
}
return;
}
@@
-425,7
+428,8
@@
void man_backend(paragraph *sourceform, keywordlist *keywords,
/*
* Tidy up.
*/
/*
* Tidy up.
*/
- fclose(fp);
+ if (fp != stdout)
+ fclose(fp);
man_conf_cleanup(conf);
}
man_conf_cleanup(conf);
}