diff options
Diffstat (limited to 'ui/ncurses/generic-main.c')
-rw-r--r-- | ui/ncurses/generic-main.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/ui/ncurses/generic-main.c b/ui/ncurses/generic-main.c index 6b8f5ba..4d154ee 100644 --- a/ui/ncurses/generic-main.c +++ b/ui/ncurses/generic-main.c @@ -234,7 +234,6 @@ int main(int argc, char *argv[]) static struct opts opts; int result; int cui_result; - FILE *log; result = opts_parse(&opts, argc, argv); @@ -253,9 +252,13 @@ int main(int argc, char *argv[]) return EXIT_SUCCESS; } - log = fopen(opts.log_file, "a"); - assert(log); - pb_log_set_stream(log); + if (strcmp(opts.log_file, "-")) { + FILE *log = fopen(opts.log_file, "a"); + + assert(log); + pb_log_set_stream(log); + } else + pb_log_set_stream(stderr); #if defined(DEBUG) pb_log_always_flush(1); |