diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-12 20:43:30 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-12 20:43:30 +0200 |
commit | ff116f01c3680d0e5d8c32dd9978ed05a37f800c (patch) | |
tree | 73765e5ac7ea4ec8af461f44f6d8288fdad6fd82 /src/s_lpipes.c | |
parent | Lots of stuff to do (diff) | |
download | 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.gz 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.bz2 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.xz 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.zst 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.zip |
FeelsCleanMan
Diffstat (limited to '')
-rw-r--r-- | src/s_lpipes.c | 19 |
1 files changed, 9 insertions, 10 deletions
diff --git a/src/s_lpipes.c b/src/s_lpipes.c index cb78df3..9d10849 100644 --- a/src/s_lpipes.c +++ b/src/s_lpipes.c @@ -14,7 +14,8 @@ #include <stdlib.h> #include <stdint.h> -#include "s_lcom.h" +#include "s_com.h" +#include "s_line.h" #include "s_lpipes.h" #include "s_struct.h" @@ -53,7 +54,7 @@ void while (tmp) { renext = tmp->next; - lcom_clear(&tmp->one); + s_com_destroy(&tmp->com); ft_memdel((void*)&tmp); tmp = renext; } @@ -62,14 +63,14 @@ void struct s_lpipes *lpipes_new(const char pipedword[], - t_msh *msh) + t_msh *msh) { struct s_lpipes *link; if (!(link = (struct s_lpipes*)malloc(sizeof(struct s_lpipes)))) return (NULL); - link->one = NULL; - if (!(link->one = lcom_new(pipedword, msh))) + link->com = NULL; + if ((link->com = s_com_new(pipedword, msh)) == NULL) { return (NULL); } @@ -79,8 +80,8 @@ struct s_lpipes struct s_lpipes *split_pipes(const char word[], - t_lcom *lcom, - t_msh *msh) + t_line *line, + t_msh *msh) { struct s_lpipes *lpipes; char **words; @@ -89,15 +90,13 @@ struct s_lpipes if (!(words = ft_split(word, '|'))) return (NULL); i = 0; - if (!(lpipes = (struct s_lpipes*)malloc(sizeof(struct s_lpipes)))) - return (NULL); while (words[i]) { if (!(lpipes = lpipes_new(words[i], msh))) { return (NULL); } - lpipes_add_back(&lcom->pipes, lpipes); + lpipes_add_back(&line->pipes, lpipes); i++; } ft_delwords(words); |