~mdw
/
sgt
/
halibut
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
Allow a hastily selected subset of the output formats to also accept
[sgt/halibut]
/
bk_text.c
diff --git
a/bk_text.c
b/bk_text.c
index
c8ded79
..
4f8cdd7
100644
(file)
--- a/
bk_text.c
+++ b/
bk_text.c
@@
-323,7
+323,10
@@
void text_backend(paragraph *sourceform, keywordlist *keywords,
/*
* Open the output file.
*/
/*
* Open the output file.
*/
- tf.fp = fopen(conf.filename, "w");
+ if (!strcmp(conf.filename, "-"))
+ tf.fp = stdout;
+ else
+ tf.fp = fopen(conf.filename, "w");
if (!tf.fp) {
error(err_cantopenw, conf.filename);
return;
if (!tf.fp) {
error(err_cantopenw, conf.filename);
return;
@@
-460,7
+463,8
@@
void text_backend(paragraph *sourceform, keywordlist *keywords,
* Tidy up
*/
text_output(&tf, NULL); /* end charset conversion */
* Tidy up
*/
text_output(&tf, NULL); /* end charset conversion */
- fclose(tf.fp);
+ if (tf.fp != stdout)
+ fclose(tf.fp);
sfree(conf.asect);
sfree(conf.filename);
}
sfree(conf.asect);
sfree(conf.filename);
}