fixed empty quotes expansions

This commit is contained in:
LuckyLaszlo
2021-12-08 03:03:16 +01:00
parent caa733e14a
commit 8a7611da92

View File

@@ -25,21 +25,16 @@ int new_token_for_each_field(char **fields, t_token **t)
i = 0;
while (fields[i])
{
if (fields[i][0])
{
insert_lst->next = ft_lstnew_generic(sizeof(t_token), 0);
insert_lst = insert_lst->next;
if (!insert_lst)
{//todo wrap
perror("insert_token_for_each_field() error");
ft_free_2d_arr(fields);
return ((int)ft_lstclear((t_list **)&head.next, NULL));
}
insert_lst->content = fields[i];
insert_lst->id = T_WORD;
insert_lst->next = ft_lstnew_generic(sizeof(t_token), 0);
insert_lst = insert_lst->next;
if (!insert_lst)
{//todo wrap
perror("insert_token_for_each_field() error");
ft_free_2d_arr(fields);
return ((int)ft_lstclear((t_list **)&head.next, NULL));
}
else
free(fields[i]);
insert_lst->content = fields[i];
insert_lst->id = T_WORD;
i++;
}
free(fields);