heredoc and builtins fix
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user