From 15a1d8d213380bd99b5dfe7f4cafcd6dedb8f0dc Mon Sep 17 00:00:00 2001 From: "Arnold D. Robbins" Date: Sat, 27 Dec 2014 21:20:47 +0200 Subject: Make nonfatal work with stdout & stderr. Update doc more. --- builtin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) (limited to 'builtin.c') 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, -- cgit v1.2.3