diff --git a/42sh/libft b/42sh/libft index 73c28532..b209bb1f 160000 --- a/42sh/libft +++ b/42sh/libft @@ -1 +1 @@ -Subproject commit 73c28532404e437d670607c909fbe56d717e9683 +Subproject commit b209bb1fb718a68256253d5ab5ff69a46a90d5d6 diff --git a/42sh/parser_init.c b/42sh/parser_init.c deleted file mode 100644 index e69de29b..00000000 diff --git a/42sh/src/exec/exec_leaf.c b/42sh/src/exec/exec_leaf.c index 2fafa04c..e8ef5244 100644 --- a/42sh/src/exec/exec_leaf.c +++ b/42sh/src/exec/exec_leaf.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 15:47:30 by wescande #+# #+# */ -/* Updated: 2017/03/08 03:25:23 by wescande ### ########.fr */ +/* Updated: 2017/03/08 11:50:20 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/exec/ft_exec.c b/42sh/src/exec/ft_exec.c index c3cb73dc..34a242b5 100644 --- a/42sh/src/exec/ft_exec.c +++ b/42sh/src/exec/ft_exec.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2016/11/27 20:30:32 by jhalford #+# #+# */ -/* Updated: 2017/03/08 03:34:10 by wescande ### ########.fr */ +/* Updated: 2017/03/08 11:57:19 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/exec/node_copy.c b/42sh/src/exec/node_copy.c index 790102fd..6c010038 100644 --- a/42sh/src/exec/node_copy.c +++ b/42sh/src/exec/node_copy.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 03:38:36 by wescande #+# #+# */ -/* Updated: 2017/03/08 04:40:50 by wescande ### ########.fr */ +/* Updated: 2017/03/08 12:01:07 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -27,10 +27,10 @@ void *node_copy(void *data) new->pattern = old->pattern; if (old->type == CMD || old->type == TK_ASSIGNEMENT_WORD) { - new->data.cmd.redir = ft_lstdup(&old->data.cmd.redir, &redir_copy); + new->data.cmd.redir = ft_lstmap(old->data.cmd.redir, &redir_copy); new->data.cmd.token = ft_ld_copy(old->data.cmd.token, &tab_esc_copy); } if (old->type == TK_FOR || old->type == TK_PAREN_OPEN || old->type == TK_CASE) - new->data.cmd.wordlist = ft_ld_copy(old->data.cmd.token, &tab_esc_copy); + new->data.cmd.wordlist = ft_ld_copy(old->data.cmd.token, &tab_esc_copy); return (new); } diff --git a/42sh/src/exec/redir_copy.c b/42sh/src/exec/redir_copy.c index 65e843e2..3dea51e4 100644 --- a/42sh/src/exec/redir_copy.c +++ b/42sh/src/exec/redir_copy.c @@ -6,7 +6,7 @@ /* By: ariard +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 00:02:58 by ariard #+# #+# */ -/* Updated: 2017/03/08 00:41:57 by ariard ### ########.fr */ +/* Updated: 2017/03/08 11:53:26 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -15,14 +15,14 @@ void *redir_copy(void *data) { t_redir *old; - t_redir *new; + t_redir *new; if (!data) return (NULL); old = data; - ft_bzero((void *)&new, sizeof(t_astdata)); + new = (t_redir *)ft_memalloc(sizeof(t_redir)); new->type = old->type; new->n = old->n; new->word = ft_strdup(old->word); - return (0); -} + return (new); +} diff --git a/42sh/src/exec/set_process.c b/42sh/src/exec/set_process.c index 336bd5bb..b3912717 100644 --- a/42sh/src/exec/set_process.c +++ b/42sh/src/exec/set_process.c @@ -6,7 +6,7 @@ /* By: jhalford +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/05 14:54:45 by jhalford #+# #+# */ -/* Updated: 2017/03/07 21:12:02 by wescande ### ########.fr */ +/* Updated: 2017/03/08 11:53:31 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ @@ -38,10 +38,8 @@ int set_process(t_process *p, t_btree *ast) p->to_close = fds[PIPE_READ]; p->fdout = fds[PIPE_WRITE]; exec->fdin = fds[PIPE_READ]; - p->redirs = ft_lstmap(cmd->redir, ft_id); + p->redirs = ft_lstmap(cmd->redir, &redir_copy); if (set_process_map(p, ast, cmd)) return (1); -// if (exec->control_count) -// p->attrs |= PROCESS_CONTROL; return (0); } diff --git a/42sh/src/exec/set_process_cmd.c b/42sh/src/exec/set_process_cmd.c index 4a7c6a1b..e2bdfd50 100644 --- a/42sh/src/exec/set_process_cmd.c +++ b/42sh/src/exec/set_process_cmd.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 15:06:05 by wescande #+# #+# */ -/* Updated: 2017/03/07 21:44:40 by wescande ### ########.fr */ +/* Updated: 2017/03/08 11:49:32 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/exec/set_process_map.c b/42sh/src/exec/set_process_map.c index 9db3679d..bdf91a50 100644 --- a/42sh/src/exec/set_process_map.c +++ b/42sh/src/exec/set_process_map.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/07 15:08:12 by wescande #+# #+# */ -/* Updated: 2017/03/08 00:23:22 by wescande ### ########.fr */ +/* Updated: 2017/03/08 11:50:08 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/42sh/src/exec/set_process_subshell.c b/42sh/src/exec/set_process_subshell.c index 897a9183..e44baf60 100644 --- a/42sh/src/exec/set_process_subshell.c +++ b/42sh/src/exec/set_process_subshell.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/08 00:02:01 by wescande #+# #+# */ -/* Updated: 2017/03/08 01:52:45 by ariard ### ########.fr */ +/* Updated: 2017/03/08 11:51:04 by jhalford ### ########.fr */ /* */ /* ************************************************************************** */