compiles now

This commit is contained in:
mdev9
2024-02-16 14:46:46 +01:00
parent 7f22e77b7b
commit f07fa4e636
3 changed files with 10 additions and 5 deletions

2
.gitignore vendored
View File

@ -1,6 +1,8 @@
# Prerequisites # Prerequisites
*.d *.d
minishell
# Object files # Object files
*.o *.o
*.ko *.ko

6
exec.c
View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/07 14:12:49 by tomoron #+# #+# */ /* 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) if (!path_in_envp)
{ {
// error: PATH not found ft_printf_fd(2, "pipex: error: PATH not found\n");
return (0); return (0);
} }
return (ft_split(cur_env_var->value, ':')); return (ft_split(cur_env_var->value, ':'));
@ -123,7 +123,7 @@ void get_cmd_path(t_cmd *cmd, t_env *env)
} }
if (!found) if (!found)
{ {
// error message: cmd->token command not found ft_printf_fd(2, "%s: command not found\n", cmd->token);
free(cmd->token); free(cmd->token);
cmd->token = 0; cmd->token = 0;
} }

View File

@ -6,7 +6,7 @@
/* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */ /* By: marde-vr <marde-vr@42angouleme.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2024/02/04 17:31:38 by tomoron #+# #+# */ /* 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 free_cmd(t_cmd *cmd);
void exec_command(t_cmd *cmd, t_env *env); void exec_command(t_cmd *cmd, t_env *env);
int echo(t_cmd *args); 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); t_env *env_add_back(t_env *env, char *name, char *value);
void free_env(t_env *env); void free_env(t_env *env);
int print_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 pwd(void);
int is_cmd_char(char c); int is_cmd_char(char c);
void print_parsed_cmd(t_cmd *cmd);//debug 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 #endif