diff options
Diffstat (limited to '')
-rw-r--r-- | src/ft_p_lcom.c | 23 |
1 files changed, 18 insertions, 5 deletions
diff --git a/src/ft_p_lcom.c b/src/ft_p_lcom.c index 9a678e6..823db3b 100644 --- a/src/ft_p_lcom.c +++ b/src/ft_p_lcom.c @@ -17,8 +17,10 @@ #include <unistd.h> #include <errno.h> +#include "ft_d_define.h" #include "ft_f_fail.h" #include "ft_s_lcom.h" +#include "ft_s_lpipes.h" #include "ft_s_struct.h" static void @@ -125,19 +127,30 @@ int8_t const uint64_t count, t_msh *msh) { - uint64_t i; - t_lcom *link; - char **words; + /* TODO: norme */ + uint64_t i; + t_lcom *link; + struct s_lpipes *lpipes; + char **words; + t_bool next; i = 0; if (!(words = ft_split(line, ';'))) return (-1); while (i <= count && words[i]) { - if (!(link = ft_lcom_new(words[i], msh))) + next = FALSE; + /* TODO: split pipes here */ + if (ft_strchr(words[i], '|')) { - return (-1); + if (!(link = ft_lcom_new(NULL, msh))) + return (-1); + if (!(lpipes = ft_split_pipes(words[i], link, msh))) + return (-1); + next = TRUE; } + if (next == FALSE && !(link = ft_lcom_new(words[i], NULL, msh))) + return (-1); ft_lcom_add_back(&msh->curr, link); i++; } |