From 487a66394061f2d14a2fa421302966b5442d643f Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Mon, 27 Jul 2020 18:55:07 +0200 Subject: I couldn't see shit --- src/m_funptr.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/m_funptr.c (limited to 'src/m_funptr.c') diff --git a/src/m_funptr.c b/src/m_funptr.c new file mode 100644 index 0000000..5a02b2e --- /dev/null +++ b/src/m_funptr.c @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* m_funptr.c :+: :+: :+: */ +/* +:+ +:+ +:+ */ +/* By: rbousset +#+ +:+ +#+ */ +/* +#+#+#+#+#+ +#+ */ +/* Created: 2020/02/14 17:19:27 by rbousset #+# #+# */ +/* Updated: 2020/02/14 17:19:29 by rbousset ### ########lyon.fr */ +/* */ +/* ************************************************************************** */ + +#include +#include + +#include "d_enum.h" +#include "b_builtins.h" +#include "f_fail.h" +#include "m_funptr.h" +#include "s_struct.h" + +void + init_buptr(t_msh *msh) +{ + msh->bu_ptr[0] = b_echo; + msh->bu_ptr[1] = b_cd; + msh->bu_ptr[2] = b_pwd; + msh->bu_ptr[3] = b_export; + msh->bu_ptr[4] = b_unset; + msh->bu_ptr[5] = b_env; + msh->bu_ptr[6] = b_exit; + msh->bu_ptr[7] = b_type; + if (!(msh->bu_ref = ft_split(FT_BUILTINS, '|'))) + { + fail_alloc(msh); + } +} -- cgit v1.2.3 From c19bd35afdb45e49cebdfd96e7adb1e6fe477f0c Mon Sep 17 00:00:00 2001 From: JozanLeClerc Date: Thu, 30 Jul 2020 20:30:58 +0200 Subject: Double exit no more --- src/m_funptr.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/m_funptr.c') diff --git a/src/m_funptr.c b/src/m_funptr.c index 5a02b2e..3bd0969 100644 --- a/src/m_funptr.c +++ b/src/m_funptr.c @@ -32,6 +32,6 @@ void msh->bu_ptr[7] = b_type; if (!(msh->bu_ref = ft_split(FT_BUILTINS, '|'))) { - fail_alloc(msh); + f_fail_alloc(msh); } } -- cgit v1.2.3