diff --git a/42sh/src/exec/process_redirect.c b/42sh/src/exec/process_redirect.c index b433aa4d..abbe0ad1 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/03/13 14:01:23 by jhalford ### ########.fr */ +/* Updated: 2017/03/15 17:57:09 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -30,6 +30,8 @@ int process_redirect(t_process *p) int i; redirs = p->redirs; + if (p->to_close != STDIN) + close(p->to_close); while (redirs) { redir = redirs->content; @@ -54,8 +56,6 @@ int process_redirect(t_process *p) redirs = redirs->next; } /* DG("redirecting [%i:%i] [%i]", p->fdin, p->fdout, p->to_close); */ - if (p->to_close != STDIN) - close(p->to_close); if (p->fdin != STDIN) dup2_close(p->fdin, STDIN); if (p->fdout != STDOUT) diff --git a/42sh/src/job-control/job_wait.c b/42sh/src/job-control/job_wait.c index e1c36928..35a053e9 100644 --- a/42sh/src/job-control/job_wait.c +++ b/42sh/src/job-control/job_wait.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/15 11:49:05 by jhalford #+# #+# */ -/* Updated: 2017/03/15 17:49:20 by jhalford ### ########.fr */ +/* Updated: 2017/03/15 17:55:00 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/main/main.c b/42sh/src/main/main.c index bf8cdd41..706b663d 100644 --- a/42sh/src/main/main.c +++ b/42sh/src/main/main.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/12/06 18:40:58 by jhalford #+# #+# */ -/* Updated: 2017/03/15 16:33:07 by gwojda ### ########.fr */ +/* Updated: 2017/03/15 17:55:12 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -70,7 +70,7 @@ int handle_instruction(int fd) return (error_syntax(&token, &parser, &ast)); } } - btree_print(STDBUG, ast, &ft_putast); + /* btree_print(STDBUG, ast, &ft_putast); */ if (ft_exec(&ast)) return (2); instruction_free(&token, &parser, &ast); diff --git a/42sh/src/parser/ft_parse.c b/42sh/src/parser/ft_parse.c index 48c2df8c..5d5f8617 100644 --- a/42sh/src/parser/ft_parse.c +++ b/42sh/src/parser/ft_parse.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/11 16:17:38 by ariard #+# #+# */ -/* Updated: 2017/03/13 17:42:06 by ariard ### ########.fr */ +/* Updated: 2017/03/15 17:56:56 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -56,7 +56,7 @@ int ft_parse(t_btree **ast, t_list **token, t_parser *parser) else parser->state = UNDEFINED; build_tree(ast, token); - btree_print(STDBUG, *ast, &ft_putast); + /* btree_print(STDBUG, *ast, &ft_putast); */ if ((end_instruction(&parser->stack) && !(*token)->next)) insert_linebreak(token); else