fix merge

This commit is contained in:
2024-04-23 19:56:19 +02:00
3 changed files with 8 additions and 2 deletions

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/03/05 18:20:21 by marde-vr #+# #+# */
/* Updated: 2024/04/23 19:54:21 by tomoron ### ########.fr */
/* Updated: 2024/04/23 19:56:00 by tomoron ### ########.fr */
/* */
/* ************************************************************************** */
@ -29,7 +29,7 @@ int cmd_is_builtin(t_msh *msh, char *cmd_token)
else if ((msh->in_type == PIPE || msh->out_type == PIPE)
&& cmd_is_forkable_builtin(cmd_token) && ft_strcmp(cmd_token, "export"))
return (1);
else if (!ft_strcmp(cmd_token, "cd"))
else if (!ft_strcmp(cmd_token, "cd") && msh->out_type != PIPE)
g_return_code = cd(msh->tokens, msh);
else if (!ft_strcmp(cmd_token, "exit"))
g_return_code = exit_bt(msh);
@ -56,6 +56,8 @@ int exec_builtin(t_msh *msh)
return (1);
else if (!ft_strcmp(msh->tokens->value, "pwd"))
g_return_code = pwd();
else if (!ft_strcmp(msh->tokens->value, "cd") && msh->out_type == PIPE)
g_return_code = cd(msh->tokens, msh);
else if (!ft_strcmp(msh->tokens->value, "cd"))
return (1);
else if (!ft_strcmp(msh->tokens->value, "export") && msh->out_type == PIPE)