diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-23 19:49:17 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-23 19:49:17 +0200 |
commit | 9c2d0ac8a7262ffa055ded74b1a01c12885b95f9 (patch) | |
tree | 55f26d76f1dc154796dbfe4ed8e5c86e3ec989aa | |
parent | execve(2) not quite working (diff) | |
download | 42-minishell-9c2d0ac8a7262ffa055ded74b1a01c12885b95f9.tar.gz 42-minishell-9c2d0ac8a7262ffa055ded74b1a01c12885b95f9.tar.bz2 42-minishell-9c2d0ac8a7262ffa055ded74b1a01c12885b95f9.tar.xz 42-minishell-9c2d0ac8a7262ffa055ded74b1a01c12885b95f9.tar.zst 42-minishell-9c2d0ac8a7262ffa055ded74b1a01c12885b95f9.zip |
C'est pas bon ca
-rw-r--r-- | src/ft_e_externs.c | 6 | ||||
-rw-r--r-- | src/minishell.c | 1 |
2 files changed, 2 insertions, 5 deletions
diff --git a/src/ft_e_externs.c b/src/ft_e_externs.c index aa67d9a..bf56878 100644 --- a/src/ft_e_externs.c +++ b/src/ft_e_externs.c @@ -59,15 +59,11 @@ ft_e_extern_child(const char *fullpath, t_msh *msh) { int32_t ret; - char arg[2][256]; - ft_strlcpy(arg[0], "/bin/ls -l", ft_strlen("/bin/ls -l")); - arg[0][2] = '\0'; - arg[1][0] = 0; (void)fullpath; (void)ptr; ft_dup_redirs(ptr, msh); - ret = execve("/bin/ls", (char *const*)arg, msh->envp); + ret = execve("/bin/ls", argv, NULL); /* TODO: handle execve failed */ ft_lcom_clear(&msh->curr); ft_s_destroy(msh); diff --git a/src/minishell.c b/src/minishell.c index 412fae1..f28b3b5 100644 --- a/src/minishell.c +++ b/src/minishell.c @@ -30,6 +30,7 @@ int (void)argc; (void)argv; + /* TODO: deal with args */ if (!(msh = ft_init_msh(envp))) { ft_fail_alloc(); |