clean: norm part 1

This commit is contained in:
Camille Chauvet
2023-03-28 15:55:08 +02:00
parent 9787d71b85
commit 2a0846fbf0
32 changed files with 360 additions and 74 deletions

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/21 12:45:16 by cchauvet #+# #+# */
/* Updated: 2023/02/28 14:56:05 by erey-bet ### ########.fr */
/* Updated: 2023/03/28 15:46:43 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
@ -22,7 +22,7 @@ static int ft_own_cmd(t_data *data, t_cmd *cmd)
else if (ft_strcmp(cmd->executable, "env") == 0)
return_code = print_env(data->env, cmd->fd_out[0]);
else if (ft_strcmp(cmd->executable, "export") == 0)
return_code = (ft_export(data->env,cmd->args + 1, cmd->fd_out[0]));
return_code = ft_export(data->env, cmd->args + 1, cmd->fd_out[0]);
else if (ft_strcmp(cmd->executable, "cd") == 0)
return_code = (move_folder(cmd->args + 1, cmd->fd_out[0]));
else if (ft_strcmp(cmd->executable, "unset") == 0)
@ -110,7 +110,7 @@ int ft_cmds_executor(t_data *data)
if (pipe(fds) == -1)
return (1);
ft_add_fd(content->fd_out, fds[1]);
ft_add_fd(((t_cmd *) (current->next->content))->fd_in, fds[0]);
ft_add_fd(((t_cmd *)(current->next->content))->fd_in, fds[0]);
}
if (ft_cmd_executor(data, content, fds[0]))
return (1);

View File

@ -1,3 +1,15 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* execution.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/28 15:46:52 by cchauvet #+# #+# */
/* Updated: 2023/03/28 15:46:53 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef EXECUTION_H
# define EXECUTION_H
# include "../data/data.h"

View File

@ -1,3 +1,15 @@
/* ************************************************************************** */
/* */
/* ::: :::::::: */
/* execution_private.h :+: :+: :+: */
/* +:+ +:+ +:+ */
/* By: cchauvet <cchauvet@student.42angouleme.fr +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/03/28 15:45:53 by cchauvet #+# #+# */
/* Updated: 2023/03/28 15:45:54 by cchauvet ### ########.fr */
/* */
/* ************************************************************************** */
#ifndef EXECUTION_PRIVATE_H
# define EXECUTION_PRIVATE_H
# include "../data/data.h"