diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-12 20:43:30 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-12 20:43:30 +0200 |
commit | ff116f01c3680d0e5d8c32dd9978ed05a37f800c (patch) | |
tree | 73765e5ac7ea4ec8af461f44f6d8288fdad6fd82 /src/e_externs.c | |
parent | Lots of stuff to do (diff) | |
download | 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.gz 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.bz2 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.xz 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.tar.zst 42-minishell-ff116f01c3680d0e5d8c32dd9978ed05a37f800c.zip |
FeelsCleanMan
Diffstat (limited to 'src/e_externs.c')
-rw-r--r-- | src/e_externs.c | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/src/e_externs.c b/src/e_externs.c index 0e3c2bb..554b3d1 100644 --- a/src/e_externs.c +++ b/src/e_externs.c @@ -21,12 +21,12 @@ #include "f_fail.h" #include "m_redirs.h" #include "s_destroy.h" -#include "s_lcom.h" +#include "s_line.h" #include "s_struct.h" static void e_extern_child(const char *fullpath, - t_lcom *ptr, + t_com *ptr, t_msh *msh) { dup_redirs(ptr, msh); @@ -35,7 +35,7 @@ static void } static void - e_export_env_fork(t_lcom *ptr, + e_export_env_fork(t_com *ptr, t_msh *msh) { char **re_ptr; @@ -50,7 +50,7 @@ static void static void exec_path(const char fullpath[], - t_lcom *ptr, + t_com *ptr, t_msh *msh) { pid_t pid; @@ -75,24 +75,24 @@ static void } void - e_extern(t_lcom *ptr, + e_extern(t_com *ptr, t_msh *msh) { char **envpath; char *fullpath; - if (ft_ischarset("./", ptr->com[0])) + if (ft_ischarset("./", ptr->bin[0])) { - exec_path(ptr->com, ptr, msh); + exec_path(ptr->bin, ptr, msh); return ; } else if ((envpath = get_env_path(msh)) != NULL) { - fullpath = search_in_path(ptr->com, envpath, msh); + fullpath = search_in_path(ptr->bin, envpath, msh); ft_delwords(envpath); if (fullpath == NULL) { - f_fail_command_not_found(ptr->com); + f_fail_command_not_found(ptr->bin); } else { |