aboutsummaryrefslogtreecommitdiffstats
path: root/profile.c
diff options
context:
space:
mode:
authorEli Zaretskii <eliz@gnu.org>2015-04-08 18:08:56 +0300
committerEli Zaretskii <eliz@gnu.org>2015-04-08 18:08:56 +0300
commitd6fecb7fa6188d819c3bc24841cebcd58082a52d (patch)
treec51a1007293fb663d723917e991d1b37f38bcff8 /profile.c
parent23393597f023f3824b56355383436ab1e52febef (diff)
downloadegawk-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.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/profile.c b/profile.c
index 28bb442a..fe411e43 100644
--- a/profile.c
+++ b/profile.c
@@ -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));