diff --git a/execution.c b/execution.c index 0a9c275..4401e91 100644 --- a/execution.c +++ b/execution.c @@ -123,12 +123,13 @@ static int ft_own_cmd(t_data *data, t_cmd *cmd) data->exit_code = exit_code; return_code = -2; } + else + return_code = -3; } - if (return_code != -1 && return_code != -2) - { - cmd->executable = NULL; + if (return_code >= 0) data->exit_code = return_code; - } + if (return_code != -1) + cmd->executable = NULL; return (return_code); }