aboutsummaryrefslogtreecommitdiffstats
path: root/builtin.c
diff options
context:
space:
mode:
authorArnold D. Robbins <arnold@skeeve.com>2014-12-27 21:20:47 +0200
committerArnold D. Robbins <arnold@skeeve.com>2014-12-27 21:20:47 +0200
commit15a1d8d213380bd99b5dfe7f4cafcd6dedb8f0dc (patch)
treeddefa874075651711ede984369749a80e4615903 /builtin.c
parent5909f454e470d5a1de2aea2451e69455bfb398ad (diff)
downloadegawk-15a1d8d213380bd99b5dfe7f4cafcd6dedb8f0dc.tar.gz
egawk-15a1d8d213380bd99b5dfe7f4cafcd6dedb8f0dc.tar.bz2
egawk-15a1d8d213380bd99b5dfe7f4cafcd6dedb8f0dc.zip
Make nonfatal work with stdout & stderr. Update doc more.
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,