diff --git a/.gitignore b/.gitignore index c6127b3..3c227fa 100755 --- a/.gitignore +++ b/.gitignore @@ -1,6 +1,8 @@ # Prerequisites *.d +minishell + # Object files *.o *.ko diff --git a/exec.c b/exec.c index ad44347..80cac38 100755 --- a/exec.c +++ b/exec.c @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/07 14:12:49 by tomoron #+# #+# */ -/* Updated: 2024/02/16 14:11:39 by marde-vr ### ########.fr */ +/* Updated: 2024/02/16 14:41:43 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ @@ -71,7 +71,7 @@ char **split_paths_from_env(t_env *env) } if (!path_in_envp) { - // error: PATH not found + ft_printf_fd(2, "pipex: error: PATH not found\n"); return (0); } return (ft_split(cur_env_var->value, ':')); @@ -123,7 +123,7 @@ void get_cmd_path(t_cmd *cmd, t_env *env) } if (!found) { - // error message: cmd->token command not found + ft_printf_fd(2, "%s: command not found\n", cmd->token); free(cmd->token); cmd->token = 0; } diff --git a/minishell.h b/minishell.h index 55c24fb..d131511 100755 --- a/minishell.h +++ b/minishell.h @@ -6,7 +6,7 @@ /* By: marde-vr +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */ -/* Updated: 2024/02/16 13:15:22 by tomoron ### ########.fr */ +/* Updated: 2024/02/16 14:36:19 by marde-vr ### ########.fr */ /* */ /* ************************************************************************** */ @@ -50,7 +50,7 @@ t_cmd *cmd_add_back(t_cmd *res, char *token, t_token_type type); void free_cmd(t_cmd *cmd); void exec_command(t_cmd *cmd, t_env *env); int echo(t_cmd *args); -void ft_exit(t_cmd *args, t_env *env); +void exit_bt(t_cmd *args, t_env *env); t_env *env_add_back(t_env *env, char *name, char *value); void free_env(t_env *env); int print_env(t_env *env); @@ -62,4 +62,7 @@ char *ft_get_env(t_env *env, char *var_name); int pwd(void); int is_cmd_char(char c); void print_parsed_cmd(t_cmd *cmd);//debug +void ft_exit(t_cmd *cmd, t_env *env, int error_code); +char **env_to_char_tab(t_env *env); + #endif