heredoc and builtins fix

This commit is contained in:
marcnava-42cursus
2026-02-14 14:26:58 +01:00
parent ba40670ace
commit 73ed56aa16
29 changed files with 1107 additions and 155 deletions

View File

@@ -91,16 +91,17 @@ static bool expand_argv(
static bool expand_redirections(
t_list *redirections,
t_minishell *minishell,
bool expand_vars
t_minishell *minishell
)
{
t_redirection *redirection;
char *expanded;
bool expand_vars;
while (redirections != NULL)
{
redirection = (t_redirection *)redirections->content;
expand_vars = (redirection->type != TOKEN_HEREDOC);
expanded = parser_expand_word(redirection->target, minishell,
expand_vars);
if (expanded == NULL)
@@ -127,8 +128,8 @@ void expand(
{
command = (t_command *)current->content;
if (!expand_argv(command, minishell)
|| !expand_redirections(command->redirections, minishell, true)
|| !expand_redirections(command->heredocs, minishell, false))
|| !expand_redirections(command->redirections, minishell)
|| !expand_redirections(command->heredocs, minishell))
{
ft_lstclear(commands, (void (*)(void *))command_clear);
*commands = NULL;