diff --git a/srcs/path.c b/srcs/path.c index 27e1885..6a369ac 100755 --- a/srcs/path.c +++ b/srcs/path.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/21 21:47:15 by marde-vr #+# #+# */ -/* Updated: 2024/05/03 12:51:56 by marde-vr ### ########.fr */ +/* Updated: 2024/05/06 13:37:25 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -99,9 +99,8 @@ void get_cmd_path(t_msh *msh) ft_printf_fd(2, "'': command not found\n"); else ft_printf_fd(2, "%s: command not found\n", msh->tokens->value); - free(msh->tokens->value); - msh->tokens->value = 0; + //free(msh->tokens->value); + //msh->tokens->value = 0; g_return_code = 127; - msh->in_fd = -2; } } diff --git a/srcs/pipe.c b/srcs/pipe.c index e40fdd0..d047263 100755 --- a/srcs/pipe.c +++ b/srcs/pipe.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/03/05 18:17:25 by marde-vr #+# #+# */ -/* Updated: 2024/05/03 13:13:36 by marde-vr ### ########.fr */ +/* Updated: 2024/05/06 13:41:24 by tomoron ### ########.fr */ /* */ /* ************************************************************************** */ @@ -18,9 +18,9 @@ void close_pipe_fds(t_msh *msh, int i) { if (i != 0) { - if (msh->fds[i - 1][0] > 2) + if (msh->fds[i - 1] && msh->fds[i - 1][0] > 2) close(msh->fds[i - 1][0]); - if (msh->fds[i - 1][1] > 2) + if (msh->fds[i - 1] && msh->fds[i - 1][1] > 2) close(msh->fds[i - 1][1]); } if (msh->fds[i] && msh->fds[i][0] > 2) @@ -74,10 +74,7 @@ void execute_command(t_msh *msh, char **cmd_args) { env = env_to_char_tab(msh->env); if (env) - { - if (execve(msh->tokens->value, cmd_args, env)) - perror("execve"); - } + execve(msh->tokens->value, cmd_args, env); ft_free_str_arr(env); } } diff --git a/todo b/todo index cd7d9bb..c4aba6b 100644 --- a/todo +++ b/todo @@ -1,3 +1,2 @@ -fsjdf | cat | cat >out |jsgdfjhsd echo uoi | << 1 << 2