This commit is contained in:
gazhonsepaskwa
2025-02-12 12:10:17 +01:00
parent 3e35d58aa3
commit a7d2ecc9e4
3 changed files with 10 additions and 5 deletions

View File

@@ -128,12 +128,15 @@ void parse_heredoc(char *limiter, t_node *lst, t_msh *msh)
void create_heredoc(t_node *lst, t_msh *msh)
{
t_node *tmp;
tmp = lst;
while (lst)
{
if (lst->pressision == HEREDOC && lst->next && lst->next->pressision)
{
lst = lst->next;
parse_heredoc(lst->val, lst, msh);
parse_heredoc(lst->val, tmp, msh);
}
lst = lst->next;
}

View File

@@ -53,13 +53,15 @@ int add_node_back(t_node **head, char *val, t_token token, t_pres pres)
void free_linked_list(t_node *head)
{
t_node *tmp;
t_node *next;
while (head)
tmp = head;
while (tmp)
{
tmp = head;
head = head->next;
next = tmp->next;
free(tmp->val);
free(tmp);
tmp = next;
}
}