diff options
-rw-r--r-- | patchlevel.h | 2 | ||||
-rw-r--r-- | redir.c | 10 |
2 files changed, 11 insertions, 1 deletions
diff --git a/patchlevel.h b/patchlevel.h index 27bb4f7..d959843 100644 --- a/patchlevel.h +++ b/patchlevel.h @@ -25,6 +25,6 @@ regexp `^#define[ ]*PATCHLEVEL', since that's what support/mkversion.sh looks for to find the patch level (for the sccs version string). */ -#define PATCHLEVEL 44 +#define PATCHLEVEL 45 #endif /* _PATCHLEVEL_H_ */ @@ -1007,6 +1007,16 @@ do_redirection_internal (redirect, flags) close (redirector); REDIRECTION_ERROR (r, errno, -1); } + if ((flags & RX_UNDOABLE) && (ri == r_move_input || ri == r_move_output)) + { + /* r_move_input and r_move_output add an additional close() + that needs to be undone */ + if (fcntl (redirector, F_GETFD, 0) != -1) + { + r = add_undo_redirect (redir_fd, r_close_this, -1); + REDIRECTION_ERROR (r, errno, -1); + } + } #if defined (BUFFERED_INPUT) check_bash_input (redirector); #endif |