ambigous redirect stops execution

This commit is contained in:
2024-04-28 14:54:32 +02:00
parent 97d5c24662
commit bb0a62342e
3 changed files with 5 additions and 71 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:15:27 by marde-vr #+# #+# */
/* Updated: 2024/04/26 13:25:15 by marde-vr ### ########.fr */
/* Updated: 2024/04/28 14:52:19 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -36,7 +36,7 @@ void redirect_input(t_msh *msh, int i, char **cmd_args)
void ambiguous_redirect(char *str, t_msh *msh)
{
ft_printf_fd(2, "minishell: %s: ambiguous redirect\n", str);
msh->in_fd = -1;
msh->in_fd = -2;
g_return_code = 1;
}
@ -66,7 +66,7 @@ int open_input_file(t_msh *msh, t_cmd **cur_token)
}
free_token(filename);
}
return (msh->in_fd == -1);
return (msh->in_fd == -2);
}
int get_in_type(t_msh *msh, t_cmd *t_strt, t_cmd *tokens, int here_doc)