diff --git a/.execution.c.swp b/.execution.c.swp deleted file mode 100644 index 99fb472..0000000 Binary files a/.execution.c.swp and /dev/null differ diff --git a/execution.c b/execution.c index 6bf9281..53eb881 100644 --- a/execution.c +++ b/execution.c @@ -6,7 +6,7 @@ /* By: cchauvet args[0], cmd->fd_out)); /* if (ft_strcmp(cmd->executable, "unset") == 0) */ /* return_code = (unset(env, cmd->args, cmd->fd_out)); */ - else if (ft_strcmp(cmd->executable, "echo") == 0) - return_code = (echo(cmd->fd_out, cmd->args + 1)); + /* else if (ft_strcmp(cmd->executable, "echo") == 0) */ + /* return_code = (echo(cmd->fd_out, cmd->args + 1)); */ else if (ft_strcmp(cmd->executable, "exit") == 0) return_code = -2; - cmd->executable = NULL; + if (return_code != -1) + cmd->executable = NULL; return (return_code); } diff --git a/minishell.h b/minishell.h index 531af7d..09dd7dd 100644 --- a/minishell.h +++ b/minishell.h @@ -6,7 +6,7 @@ /* By: cchauvet