diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-27 18:55:07 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-07-27 18:55:07 +0200 |
commit | 487a66394061f2d14a2fa421302966b5442d643f (patch) | |
tree | 34237d4e9cb85f94bcefd46f399d2224dff3f6b3 /src/e_externs.c | |
parent | Correct shell prompt (diff) | |
download | 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.gz 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.bz2 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.xz 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.tar.zst 42-minishell-487a66394061f2d14a2fa421302966b5442d643f.zip |
I couldn't see shit
Diffstat (limited to '')
-rw-r--r-- | src/e_externs.c (renamed from src/ft_e_externs.c) | 30 |
1 files changed, 15 insertions, 15 deletions
diff --git a/src/ft_e_externs.c b/src/e_externs.c index 9302d18..d7c4854 100644 --- a/src/ft_e_externs.c +++ b/src/e_externs.c @@ -1,7 +1,7 @@ /* ************************************************************************** */ /* */ /* ::: :::::::: */ -/* ft_e_externs.c :+: :+: :+: */ +/* e_externs.c :+: :+: :+: */ /* +:+ +:+ +:+ */ /* By: rbousset <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ @@ -16,24 +16,24 @@ #include <stdint.h> #include <unistd.h> -#include "ft_e_externs_next.h" -#include "ft_m_redirs.h" -#include "ft_s_destroy.h" -#include "ft_s_lcom.h" -#include "ft_s_struct.h" +#include "e_externs_next.h" +#include "m_redirs.h" +#include "s_destroy.h" +#include "s_lcom.h" +#include "s_struct.h" static void - ft_e_extern_child(const char *fullpath, + e_extern_child(const char *fullpath, t_lcom *ptr, t_msh *msh) { - ft_dup_redirs(ptr, msh); + dup_redirs(ptr, msh); execve(fullpath, ptr->argv, msh->envp); /* TODO: handle execve failed */ } static void - ft_exec_path(const char fullpath[], + exec_path(const char fullpath[], t_lcom *ptr, t_msh *msh) { @@ -42,7 +42,7 @@ static void if ((pid = fork()) == 0) { - ft_e_extern_child(fullpath, ptr, msh); + e_extern_child(fullpath, ptr, msh); } else if (pid < 0) { @@ -57,7 +57,7 @@ static void } void - ft_e_extern(t_lcom *ptr, + e_extern(t_lcom *ptr, t_msh *msh) { char **envpath; @@ -65,15 +65,15 @@ void if (ft_ischarset("/.", ptr->com[0])) { - ft_exec_path(ptr->com, ptr, msh); + exec_path(ptr->com, ptr, msh); return ; } - else if ((envpath = ft_get_env_path(msh)) != NULL) + else if ((envpath = get_env_path(msh)) != NULL) { - fullpath = ft_search_in_path(ptr->com, envpath, msh); + fullpath = search_in_path(ptr->com, envpath, msh); ft_delwords(envpath); } /* TODO: deal if not found etc */ - ft_exec_path(fullpath, ptr, msh); + exec_path(fullpath, ptr, msh); ft_memdel((void*)&fullpath); } |