summaryrefslogtreecommitdiffstats
path: root/src/minishell.c
diff options
context:
space:
mode:
authorJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 16:40:34 +0200
committerJozanLeClerc <bousset.rudy@gmail.com>2020-04-25 16:40:34 +0200
commite42601eb5acc07417b217dfed4e9ab8cbb91794f (patch)
tree76e7dacd2e8d93012fecf2c29fcb4d14e6d1baed /src/minishell.c
parent(fd)>qwe fd agregation redir works (diff)
download42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.gz
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.bz2
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.xz
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.tar.zst
42-minishell-e42601eb5acc07417b217dfed4e9ab8cbb91794f.zip
Stupid bash rule
Diffstat (limited to '')
-rw-r--r--src/minishell.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/src/minishell.c b/src/minishell.c
index 1b5f4da..1df809b 100644
--- a/src/minishell.c
+++ b/src/minishell.c
@@ -12,9 +12,11 @@
#include <libft.h>
#include <stdint.h>
+#include <string.h>
+#include <errno.h>
#include "ft_f_fail.h"
-#include "ft_m_loop.h"
+#include "ft_m_argv.h"
#include "ft_s_struct.h"
#include "ft_s_init.h"
#include "ft_s_destroy.h"
@@ -27,15 +29,13 @@ int
t_msh *msh;
int32_t ret;
- (void)argc;
- (void)argv;
- /* TODO: deal with args */
+ /* TODO: increment $SHLVL */
if (!(msh = ft_init_msh(envp)))
{
- ft_fail_alloc();
+ ft_dprintf(2, "%s\n", strerror(errno));
+ return (FT_RET_ALLOC);
}
- msh->ret = ft_m_loop(msh);
- ret = msh->ret;
+ ret = ft_m_argv(argc, argv, msh);
ft_s_destroy(msh);
return (ret);
}