fix subsh in pipeline

This commit is contained in:
Loic Deridder
2025-02-18 11:09:23 +01:00
parent 00d2420d9f
commit 588db5280f
2 changed files with 4 additions and 4 deletions

View File

@@ -34,7 +34,7 @@ t_node *remove_parentheses(t_node *lst)
if (deepness == 0) if (deepness == 0)
break ; break ;
add_node_back(&out, str, it->token, it->pressision); add_node_back(&out, str, it->token, it->pressision);
free(str); ft_free(&str);
it = it->next; it = it->next;
} }
ft_free(&str); ft_free(&str);

View File

@@ -36,9 +36,9 @@ static void update_subsh_l(int *shlvl, t_node *lst)
if (!lst) if (!lst)
return ; return ;
if (!ft_strncmp(")", lst->val, 1)) if (!ft_strncmp(")", lst->val, 1))
*shlvl = 0; *shlvl -= 1;
if (!ft_strncmp("(", lst->val, 1)) if (!ft_strncmp("(", lst->val, 1))
*shlvl = 1; *shlvl += 1;
} }
static t_node *get_node(t_node **lst, t_node *expected, static t_node *get_node(t_node **lst, t_node *expected,
@@ -53,7 +53,7 @@ static t_node *get_node(t_node **lst, t_node *expected,
(*lst) = (*lst)->next; (*lst) = (*lst)->next;
} }
while (limiter == -1 && (*lst) while (limiter == -1 && (*lst)
&& (*shlvl == 1 && (*shlvl >= 2
|| ft_strncmp((*lst)->val, expected->val, ft_strlen((*lst)->val)))) || ft_strncmp((*lst)->val, expected->val, ft_strlen((*lst)->val))))
{ {
update_subsh_l(shlvl, *lst); update_subsh_l(shlvl, *lst);