diff --git a/42sh/src/exec/process_redirect.c b/42sh/src/exec/process_redirect.c index 925a6b92..dfe8615b 100644 --- a/42sh/src/exec/process_redirect.c +++ b/42sh/src/exec/process_redirect.c @@ -6,7 +6,7 @@ /* 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 */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/exec/redirect_greatand.c b/42sh/src/exec/redirect_greatand.c index 1dd2fb4e..10abaa48 100644 --- a/42sh/src/exec/redirect_greatand.c +++ b/42sh/src/exec/redirect_greatand.c @@ -6,7 +6,7 @@ /* 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 fdnew; + if (redir->word.fd == redir->n) + return (0); if (redir->word.fd > 9) bad_fd(redir->word.fd); if (redir->close) diff --git a/42sh/src/exec/redirect_lessand.c b/42sh/src/exec/redirect_lessand.c index 6109abe1..fa4450b9 100644 --- a/42sh/src/exec/redirect_lessand.c +++ b/42sh/src/exec/redirect_lessand.c @@ -6,7 +6,7 @@ /* 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 fdnew; + if (redir->word.fd == redir->n) + return (0); if (redir->word.fd > 9) bad_fd(redir->word.fd); if (redir->close)