general fixes to redirects

This commit is contained in:
Quinten 2025-02-23 13:11:06 +01:00
parent ea90a00c33
commit fd72fbb0d3
3 changed files with 5 additions and 1 deletions

View File

@ -14,7 +14,7 @@
static int is_command_token(t_token *token)
{
return (token->type < 3 || redirect_token_type(token));
return (token->type < 3 || token->type == T_REDIRECT_IN || token->type ==T_HEREDOC || token->type == T_REDIRECT_OUT || token->type == T_APPEND_OUT);
}
t_list *parser_get_commands(t_minishell *minishell)

View File

@ -23,6 +23,8 @@ t_list *redirect_get_inputs(t_list *list)
while (current)
{
token = (t_token *)current->content;
if (token->type == T_PIPE || token->type == T_EOF)
break ;
if (token->type != T_REDIRECT_IN && token->type != T_HEREDOC)
{
current = current->next;

View File

@ -23,6 +23,8 @@ t_list *redirect_get_outputs(t_list *list)
while (current)
{
token = (t_token *)current->content;
if (token->type == T_PIPE || token->type == T_EOF)
break;
if (token->type != T_REDIRECT_OUT && token->type != T_APPEND_OUT)
{
current = current->next;