From f5c35a73d8e133b4cac0c0c0e8f66f7da4df5e3d Mon Sep 17 00:00:00 2001 From: Jack Halford Date: Mon, 13 Mar 2017 16:27:07 +0100 Subject: [PATCH] heredoc with io_number OK --- 42sh/src/exec/redirect_dless.c | 2 +- 42sh/src/parser/add_redir.c | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/42sh/src/exec/redirect_dless.c b/42sh/src/exec/redirect_dless.c index 5bcd3aa3..60cb85c2 100644 --- a/42sh/src/exec/redirect_dless.c +++ b/42sh/src/exec/redirect_dless.c @@ -22,7 +22,7 @@ int redirect_dless(t_redir *redir) DG("redir @ %p", redir); write(fds[PIPE_WRITE], str, ft_strlen(str)); close(fds[PIPE_WRITE]); - dup2(fds[PIPE_READ], 0); + dup2(fds[PIPE_READ], redir->n); close(fds[PIPE_READ]); return (0); } diff --git a/42sh/src/parser/add_redir.c b/42sh/src/parser/add_redir.c index 9254025e..3cdc9a25 100644 --- a/42sh/src/parser/add_redir.c +++ b/42sh/src/parser/add_redir.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/17 16:39:05 by ariard #+# #+# */ -/* Updated: 2017/03/13 16:23:35 by jhalford ### ########.fr */ +/* Updated: 2017/03/13 16:24:44 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */