bugfix expansions

This commit is contained in:
LuckyLaszlo
2021-11-08 04:02:43 +01:00
parent 0a5c7545c1
commit 0ae84abb14
4 changed files with 37 additions and 29 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/11/07 02:01:33 by lperrey #+# #+# */
/* Updated: 2021/11/07 04:36:52 by lperrey ### ########.fr */
/* Updated: 2021/11/08 03:59:02 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -45,23 +45,18 @@ int words_expansions(t_token *t)
tmp_expand = expand_token(t);
if (!tmp_expand)
return (0);
if (((t_list*)tmp_expand)->next)
{
// 2
tmp_expand = rejoin_after_expand(tmp_expand);
if (!tmp_expand)
return (0);
// 3 WIP PLACEHOLDER, MUST WRITE A ft_split_quoted() FOR NO SPLIT IN QUOTES
tmp_split = ft_split(tmp_expand, ' ');
free(tmp_expand);
if (!tmp_split)
return (0);
// 4
if (!new_token_for_each_field(tmp_split, &t))
return (0);
}
else
ft_lstclear((t_list **)&tmp_expand, free);
// 2
tmp_expand = rejoin_after_expand(tmp_expand);
if (!tmp_expand)
return (0);
// 3 WIP PLACEHOLDER, MUST WRITE A ft_split_quoted() FOR NO SPLIT IN QUOTES
tmp_split = ft_split(tmp_expand, ' ');
free(tmp_expand);
if (!tmp_split)
return (0);
// 4
if (!new_token_for_each_field(tmp_split, &t))
return (0);
}
t = t->next;
}