diff --git a/parse/parse.c b/parse/parse.c index 27fbc23..f5cc5c2 100644 --- a/parse/parse.c +++ b/parse/parse.c @@ -6,7 +6,7 @@ /* By: cchauvet ", redirection[0])) + { + ft_eprintf("minishell: %s: invalid redirection file\n", redirection); + return (1); + } + str = ft_strdup(redirection); + if (str == NULL) + { + ft_eprintf("minishell: malloc failed\n"); + return (1); + } + ft_quote_remover(str); + return_code = (ft_check_heredoc(data, cmd, redirection_identifier, str) + || ft_check_infile(data, cmd, redirection_identifier, str) + || ft_check_outfile(data, cmd, redirection_identifier, str) + || ft_check_outfile_append(data, cmd, redirection_identifier, + str)); + free(str); + return (return_code); } diff --git a/redirection/redirection.c b/redirection/redirection.c index 10bc034..079fde0 100644 --- a/redirection/redirection.c +++ b/redirection/redirection.c @@ -6,7 +6,7 @@ /* By: cchauvet ", tab[i][0])) + { + ft_eprintf("minishell: %s: must be followed by a file\n", tab[i]); + return (1); + } return (0); }