redirection of identical fds does nothing

This commit is contained in:
Jack Halford 2017-02-07 12:03:22 +01:00
parent d7f5116eb0
commit 8ae6910122
3 changed files with 7 additions and 3 deletions

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/11/29 16:04:18 by jhalford #+# #+# */ /* Created: 2016/11/29 16:04:18 by jhalford #+# #+# */
/* Updated: 2017/02/06 22:23:33 by jhalford ### ########.fr */ /* Updated: 2017/02/07 12:01:06 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/06 22:12:31 by jhalford #+# #+# */ /* Created: 2017/02/06 22:12:31 by jhalford #+# #+# */
/* Updated: 2017/02/06 22:54:20 by jhalford ### ########.fr */ /* Updated: 2017/02/07 12:01:45 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -17,6 +17,8 @@ int redirect_greatand(t_redir *redir)
int fdold; int fdold;
int fdnew; int fdnew;
if (redir->word.fd == redir->n)
return (0);
if (redir->word.fd > 9) if (redir->word.fd > 9)
bad_fd(redir->word.fd); bad_fd(redir->word.fd);
if (redir->close) if (redir->close)

View file

@ -6,7 +6,7 @@
/* By: jhalford <jack@crans.org> +#+ +:+ +#+ */ /* By: jhalford <jack@crans.org> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/02/06 22:11:18 by jhalford #+# #+# */ /* Created: 2017/02/06 22:11:18 by jhalford #+# #+# */
/* Updated: 2017/02/06 22:55:03 by jhalford ### ########.fr */ /* Updated: 2017/02/07 12:01:56 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -17,6 +17,8 @@ int redirect_lessand(t_redir *redir)
int fdold; int fdold;
int fdnew; int fdnew;
if (redir->word.fd == redir->n)
return (0);
if (redir->word.fd > 9) if (redir->word.fd > 9)
bad_fd(redir->word.fd); bad_fd(redir->word.fd);
if (redir->close) if (redir->close)