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