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

@@ -63,6 +63,20 @@ static bool process_word_fields(
return (true);
}
static bool set_empty_word_field(
t_list **fields,
t_minishell *minishell
)
{
t_list *node;
node = ft_lstnew(ft_strdup(""));
if (node == NULL || node->content == NULL)
return (free(node), parser_expand_malloc_error(minishell), false);
*fields = node;
return (true);
}
bool parser_expand_word_fields(
const char *word,
t_minishell *minishell,
@@ -75,6 +89,8 @@ bool parser_expand_word_fields(
t_fields_ctx ctx;
*fields = NULL;
if (word[0] == '\0')
return (set_empty_word_field(fields, minishell));
current = ft_strdup("");
if (current == NULL)
return (parser_expand_malloc_error(minishell), false);