srcs a la norme
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/10/24 10:52:40 by lperrey #+# #+# */
|
||||
/* Updated: 2021/12/16 16:23:09 by lperrey ### ########.fr */
|
||||
/* Updated: 2021/12/20 16:22:13 by hulamy ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -20,20 +20,14 @@ t_cmd **parsing(t_token *token_list)
|
||||
|
||||
if (!valid_syntax(token_list))
|
||||
return (NULL);
|
||||
|
||||
// 2.9.1 - 1) Save Words
|
||||
save_redirections_words(token_list);
|
||||
// Struct CMD alloc
|
||||
pipeline = pipeline_alloc(1 + count_pipes(token_list));
|
||||
if (!pipeline)
|
||||
return (NULL);
|
||||
// 2.9.1 - 2) Expansion
|
||||
if (!expansions(token_list, pipeline))
|
||||
return (ft_retp_free(NULL, &pipeline, (t_free_f)free_pipeline));
|
||||
// 2.9.1 - 3) Redirection
|
||||
if (!redirections(token_list, pipeline))
|
||||
return (ft_retp_free(NULL, &pipeline, (t_free_f)free_pipeline));
|
||||
// Struct CMD fill
|
||||
if (!pipeline_fill_argv(token_list, pipeline))
|
||||
return (ft_retp_free(NULL, &pipeline, (t_free_f)free_pipeline));
|
||||
return (pipeline);
|
||||
@@ -44,7 +38,7 @@ void save_redirections_words(t_token *t)
|
||||
while (t)
|
||||
{
|
||||
if (t->id == '>' || t->id == T_DGREAT
|
||||
|| t->id == '<' || t->id == T_DLESS)
|
||||
|| t->id == '<' || t->id == T_DLESS)
|
||||
{
|
||||
t = t->next;
|
||||
t->id = T_REDIRECTION_WORD;
|
||||
|
||||
Reference in New Issue
Block a user