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 +#+ +:+ +#+ */
|
/* By: mmoussou <mmoussou@student.42angouleme.fr +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2023/10/30 23:06:24 by mmoussou #+# #+# */
|
/* 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 */
|
||||||
/* */
|
/* */
|
||||||
/* ************************************************************************** */
|
/* ************************************************************************** */
|
||||||
|
|
||||||
@ -14,7 +14,7 @@
|
|||||||
|
|
||||||
# define LIBFT_H
|
# define LIBFT_H
|
||||||
|
|
||||||
#include <sys/types.h> // for macos compilation
|
# include <sys/types.h> // for macos compilation
|
||||||
# include <limits.h>
|
# include <limits.h>
|
||||||
# include <stdint.h>
|
# include <stdint.h>
|
||||||
# include <stdlib.h>
|
# include <stdlib.h>
|
||||||
|
@ -6,7 +6,7 @@
|
|||||||
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
/* By: adjoly <adjoly@student.42angouleme.fr> +#+ +:+ +#+ */
|
||||||
/* +#+#+#+#+#+ +#+ */
|
/* +#+#+#+#+#+ +#+ */
|
||||||
/* Created: 2024/05/30 10:48:41 by adjoly #+# #+# */
|
/* 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 <stdio.h>
|
||||||
#include "libft.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_cmd *get_redir_fd(void *content, t_list *tmp)
|
||||||
{
|
{
|
||||||
t_redir_sign sign[2];
|
t_redir_sign sign[2];
|
||||||
@ -31,10 +37,9 @@ t_cmd *get_redir_fd(void *content, t_list *tmp)
|
|||||||
while (tmp)
|
while (tmp)
|
||||||
{
|
{
|
||||||
open_redir((t_redirection *)tmp->content, cmd, sign);
|
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)
|
parsing_msg(cmd);
|
||||||
send_error_parsing(ERROR_NO_FILE);
|
|
||||||
free(cmd);
|
free(cmd);
|
||||||
return (NULL);
|
return (NULL);
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user