diff options
author | Eli Zaretskii <eliz@gnu.org> | 2015-04-08 18:08:56 +0300 |
---|---|---|
committer | Eli Zaretskii <eliz@gnu.org> | 2015-04-08 18:08:56 +0300 |
commit | d6fecb7fa6188d819c3bc24841cebcd58082a52d (patch) | |
tree | c51a1007293fb663d723917e991d1b37f38bcff8 /profile.c | |
parent | 23393597f023f3824b56355383436ab1e52febef (diff) | |
download | egawk-d6fecb7fa6188d819c3bc24841cebcd58082a52d.tar.gz egawk-d6fecb7fa6188d819c3bc24841cebcd58082a52d.tar.bz2 egawk-d6fecb7fa6188d819c3bc24841cebcd58082a52d.zip |
Allow to redirect profile to stdout more portably.
Diffstat (limited to 'profile.c')
-rw-r--r-- | profile.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -66,7 +66,10 @@ void set_prof_file(const char *file) { assert(file != NULL); - prof_fp = fopen(file, "w"); + if (strcmp(file, "-") == 0) + prof_fp = stdout; + else + prof_fp = fopen(file, "w"); if (prof_fp == NULL) { warning(_("could not open `%s' for writing: %s"), file, strerror(errno)); |