fix
This commit is contained in:
parent
ca18dd4205
commit
07bc37cc71
@ -110,7 +110,7 @@ static int ft_own_cmd(t_data *data, t_cmd *cmd)
|
|||||||
else if (ft_strcmp(cmd->executable, "export") == 0)
|
else if (ft_strcmp(cmd->executable, "export") == 0)
|
||||||
return_code = (export(data->env,cmd->args + 1, cmd->fd_out));
|
return_code = (export(data->env,cmd->args + 1, cmd->fd_out));
|
||||||
else if (ft_strcmp(cmd->executable, "cd") == 0)
|
else if (ft_strcmp(cmd->executable, "cd") == 0)
|
||||||
return_code = (move_folder(cmd->args[1], cmd->fd_out));
|
return_code = (move_folder(cmd->args + 1, cmd->fd_out));
|
||||||
if (ft_strcmp(cmd->executable, "unset") == 0)
|
if (ft_strcmp(cmd->executable, "unset") == 0)
|
||||||
return_code = (unset(data->env, cmd->args, cmd->fd_out));
|
return_code = (unset(data->env, cmd->args, cmd->fd_out));
|
||||||
else if (ft_strcmp(cmd->executable, "echo") == 0)
|
else if (ft_strcmp(cmd->executable, "echo") == 0)
|
||||||
@ -124,7 +124,7 @@ static int ft_own_cmd(t_data *data, t_cmd *cmd)
|
|||||||
return_code = -2;
|
return_code = -2;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (return_code != -1)
|
if (return_code != -1 && return_code != -2)
|
||||||
{
|
{
|
||||||
cmd->executable = NULL;
|
cmd->executable = NULL;
|
||||||
data->exit_code = return_code;
|
data->exit_code = return_code;
|
||||||
|
Loading…
Reference in New Issue
Block a user