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/b_env.c | 37 +++++++++++++++++++++++++++++++++++++ 1 file changed, 37 insertions(+) create mode 100644 src/b_env.c (limited to 'src/b_env.c') diff --git a/src/b_env.c b/src/b_env.c new file mode 100644 index 0000000..08adaf5 --- /dev/null +++ b/src/b_env.c @@ -0,0 +1,37 @@ +/* ************************************************************************** */ +/* */ +/* ::: :::::::: */ +/* b_env.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 "f_fail.h" +#include "s_struct.h" + +uint8_t + b_env(char *args[], + t_msh *msh) +{ + char **ptr; + + if (args && args[0]) + { + fail_no_options("env", msh); + return (127); + } + ptr = msh->envp; + while (*ptr) + { + ft_printf("%s\n", *ptr); + ptr++; + } + return (0); +} -- 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/b_env.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'src/b_env.c') diff --git a/src/b_env.c b/src/b_env.c index 08adaf5..8f0a974 100644 --- a/src/b_env.c +++ b/src/b_env.c @@ -24,7 +24,7 @@ uint8_t if (args && args[0]) { - fail_no_options("env", msh); + f_fail_no_options("env", msh); return (127); } ptr = msh->envp; -- cgit v1.2.3