mirror of
https://github.com/KeyZox71/ft_minipowershell.git
synced 2025-03-15 03:16:51 +01:00
「🔨」 fix: Error when in or out not valid
This commit is contained in:
@ -6,7 +6,7 @@
|
||||
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2023/10/30 23:06:24 by mmoussou #+# #+# */
|
||||
/* Updated: 2024/07/29 19:23:16 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/30 19:04:19 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
@ -6,7 +6,7 @@
|
||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/05/30 10:48:41 by adjoly #+# #+# */
|
||||
/* Updated: 2024/07/30 17:17:13 by adjoly ### ########.fr */
|
||||
/* Updated: 2024/07/30 19:03:54 by adjoly ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@ -18,6 +18,12 @@
|
||||
#include <stdio.h>
|
||||
#include "libft.h"
|
||||
|
||||
void parsing_msg(t_cmd *cmd)
|
||||
{
|
||||
if (cmd->infile == -1 || cmd->outfile == -1)
|
||||
send_error_parsing(ERROR_NO_FILE);
|
||||
}
|
||||
|
||||
t_cmd *get_redir_fd(void *content, t_list *tmp)
|
||||
{
|
||||
t_redir_sign sign[2];
|
||||
@ -31,10 +37,9 @@ t_cmd *get_redir_fd(void *content, t_list *tmp)
|
||||
while (tmp)
|
||||
{
|
||||
open_redir((t_redirection *)tmp->content, cmd, sign);
|
||||
if (cmd->infile >= -1 || cmd->outfile == -1)
|
||||
if (cmd->infile <= -1 || cmd->outfile == -1)
|
||||
{
|
||||
if (cmd->infile == -1 || cmd->outfile == -1)
|
||||
send_error_parsing(ERROR_NO_FILE);
|
||||
parsing_msg(cmd);
|
||||
free(cmd);
|
||||
return (NULL);
|
||||
}
|
||||
|
Reference in New Issue
Block a user