diff --git a/42sh/src/glob/command_getoutput.c b/42sh/src/glob/command_getoutput.c index b82b745e..52fb71a7 100644 --- a/42sh/src/glob/command_getoutput.c +++ b/42sh/src/glob/command_getoutput.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/03/14 19:44:25 by wescande #+# #+# */ -/* Updated: 2017/03/14 23:11:39 by wescande ### ########.fr */ +/* Updated: 2017/03/15 23:17:21 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -36,6 +36,7 @@ char *command_getoutput(char *command) int ret; int pid; int fds[2]; + char **av; if (!command) return (NULL); @@ -44,9 +45,10 @@ char *command_getoutput(char *command) { close(fds[PIPE_READ]); dup2_close(fds[PIPE_WRITE], STDOUT); - execle(data_singleton()->argv[0], data_singleton()->argv[0], - "-c", command, NULL, - data_singleton()->env); + av = ft_sstradd(NULL, data_singleton()->argv[0]); + av = ft_sstradd(av, "-c"); + av = ft_sstradd(av, command); + execve(data_singleton()->argv[0], av, data_singleton()->env); exit(1); } waitpid(pid, &ret, WUNTRACED); diff --git a/42sh/src/glob/expand_bquote.c b/42sh/src/glob/expand_bquote.c index 08bd2da6..6f900f86 100644 --- a/42sh/src/glob/expand_bquote.c +++ b/42sh/src/glob/expand_bquote.c @@ -6,7 +6,7 @@ /* By: wescande +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2017/02/17 17:47:53 by wescande #+# #+# */ -/* Updated: 2017/03/14 23:53:12 by wescande ### ########.fr */ +/* Updated: 2017/03/15 23:18:56 by wescande ### ########.fr */ /* */ /* ************************************************************************** */ @@ -43,7 +43,7 @@ static void init_expand(t_bquote *me, char *content, int esc) char *ifs; char *content2; - ifs = esc ? NULL : ft_getenv(data_singleton()->env, "IFS"); + ifs = esc ? NULL : ft_getenv(data_singleton()->local_var, "IFS"); content = ft_strtok(content, ifs); if (!content || !(content2 = ft_strtok(NULL, ifs))) {