path of cmd ok

This commit is contained in:
hugogogo
2021-10-30 14:43:06 +02:00
parent 75987a117e
commit 0292425bc1
3 changed files with 134 additions and 64 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/04 05:59:26 by lperrey #+# #+# */
/* Updated: 2021/10/29 12:49:08 by hulamy ### ########.fr */
/* Updated: 2021/10/30 14:37:31 by hulamy ### ########.fr */
/* */
/* ************************************************************************** */
@@ -68,14 +68,15 @@ void shell_loop(t_all *c)
// EXEC_PIPES_AND_CO()
// temp placeholder
if (ft_strncmp(c->token_list->content, "env", 4) == 0)
builtin_env(0, NULL, c);
else if (ft_strncmp(c->token_list->content, "exit", 5) == 0)
builtin_exit(0, NULL, c);
else if (ft_strncmp(c->token_list->content, "echo", 5) == 0)
builtin_echo(ft_lstsize((t_list *)c->token_list) + 1, tokens_list_to_argv(c->token_list), c);
else
{
(void)tokens_list_to_argv;
// if (ft_strncmp(c->token_list->content, "env", 4) == 0)
// builtin_env(0, NULL, c);
// else if (ft_strncmp(c->token_list->content, "exit", 5) == 0)
// builtin_exit(0, NULL, c);
// else if (ft_strncmp(c->token_list->content, "echo", 5) == 0)
// builtin_echo(ft_lstsize((t_list *)c->token_list) + 1, tokens_list_to_argv(c->token_list), c);
// else
// {
c->cmd_arr = parsing(c->token_list, c->envp);
if (c->cmd_arr == NULL)
ft_putstr_fd("Syntax KO:\n-----------\n", 1);
@@ -85,7 +86,7 @@ void shell_loop(t_all *c)
ft_lstprint((t_list *)c->token_list, 1);
// execute_cmd(c->envp, c->cmd_arr);
ft_lstclear((t_list **)&c->token_list, free);
}
// }
}
}
}