diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-08 19:32:40 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-09-08 19:32:40 +0200 |
commit | d742075e1af0c063ef9677f157263c0d45253f73 (patch) | |
tree | 656be50d447b90308647a253e3ba6ba75a751b13 /src/p_lblock.c | |
parent | Update (diff) | |
download | 42-minishell-d742075e1af0c063ef9677f157263c0d45253f73.tar.gz 42-minishell-d742075e1af0c063ef9677f157263c0d45253f73.tar.bz2 42-minishell-d742075e1af0c063ef9677f157263c0d45253f73.tar.xz 42-minishell-d742075e1af0c063ef9677f157263c0d45253f73.tar.zst 42-minishell-d742075e1af0c063ef9677f157263c0d45253f73.zip |
Rework in progress
Diffstat (limited to 'src/p_lblock.c')
-rw-r--r-- | src/p_lblock.c | 12 |
1 files changed, 6 insertions, 6 deletions
diff --git a/src/p_lblock.c b/src/p_lblock.c index 5be1c9d..856a546 100644 --- a/src/p_lblock.c +++ b/src/p_lblock.c @@ -1,7 +1,7 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* p_lcom.c :+: :+: :+: */ +/* p_lblock.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ @@ -125,13 +125,14 @@ int8_t { /* TODO: norme */ uint64_t i; - t_line *link; + t_line_block *link; char **words; char *ptr; uint8_t nextif; t_bool next; i = 0; + nextif = 0; if ((words = p_split_line(line)) == NULL) return (-1); while (words[i] != NULL) @@ -146,15 +147,14 @@ int8_t next = FALSE; if ((ptr = ft_strchr(words[i], '|')) != NULL) { - if ((link = s_line_new(NULL, msh)) == NULL) + if ((link = s_line_new(NULL, 0)) == NULL) return (-1); - if ((s_split_pipes(words[i], link, msh)) == NULL) + if ((s_split_pipes(words[i], msh)) == NULL) return (-1); next = TRUE; } - if (next == FALSE && (link = s_line_new(words[i], msh)) == NULL) + if (next == FALSE && (link = s_line_new(words[i], nextif)) == NULL) return (-1); - link->nextif = nextif; s_line_add_back(&msh->curr, link); i++; } |