aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin.c')
-rw-r--r--builtin.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/builtin.c b/builtin.c
index b3f3f333..e80d46d4 100644
--- a/builtin.c
+++ b/builtin.c
@@ -129,8 +129,10 @@ wrerror:
if (fp == stdout && errno == EPIPE)
gawk_exit(EXIT_FATAL);
+
/* otherwise die verbosely */
- if ((rp->flag & RED_NON_FATAL) != 0) {
+ if ( (rp != NULL && (rp->flag & RED_NON_FATAL) != 0)
+ || is_non_fatal_std(fp)) {
update_ERRNO_int(errno);
} else
fatal(_("%s to \"%s\" failed (%s)"), from,