diff options
author | Arnold D. Robbins <arnold@skeeve.com> | 2016-04-05 21:41:39 +0300 |
---|---|---|
committer | Arnold D. Robbins <arnold@skeeve.com> | 2016-04-05 21:41:39 +0300 |
commit | db6e8faca70e60d2fa80e0affda3d9bef1e82eae (patch) | |
tree | 2ede6812410f1bfdba4e098a3d9dd92d725232f1 /io.c | |
parent | 2adf64c7b99ec6e8d1e4689b6484ace5295580b6 (diff) | |
parent | 1b5d1b8870cb0ac1c4b99f6cf67e3277427df864 (diff) | |
download | egawk-db6e8faca70e60d2fa80e0affda3d9bef1e82eae.tar.gz egawk-db6e8faca70e60d2fa80e0affda3d9bef1e82eae.tar.bz2 egawk-db6e8faca70e60d2fa80e0affda3d9bef1e82eae.zip |
Merge branch 'gawk-4.1-stable'
Diffstat (limited to 'io.c')
-rw-r--r-- | io.c | 5 |
1 files changed, 4 insertions, 1 deletions
@@ -1391,7 +1391,7 @@ flush_io() warning(_("error writing standard error (%s)"), strerror(errno)); status++; } - for (rp = red_head; rp != NULL; rp = rp->next) + for (rp = red_head; rp != NULL; rp = rp->next) { /* flush both files and pipes, what the heck */ if ((rp->flag & RED_WRITE) != 0 && rp->output.fp != NULL) { if (rp->output.gawk_fflush(rp->output.fp, rp->output.opaque)) { @@ -1407,6 +1407,7 @@ flush_io() status++; } } + } if (status != 0) status = -1; /* canonicalize it */ return status; @@ -2602,6 +2603,8 @@ do_getline_redir(int into_variable, enum redirval redirtype) update_ERRNO_int(redir_error); } return make_number((AWKNUM) -1.0); + } else if ((rp->flag & RED_TWOWAY) != 0 && rp->iop == NULL) { + fatal(_("getline: attempt to read from closed read end of two-way pipe")); } iop = rp->iop; if (iop == NULL) /* end of input */ |