Browse Source

[enh] heredoc: directly call execution to avoid passing on many code.

Moul 2 years ago
parent
commit
19fcebb780
1 changed files with 6 additions and 1 deletions
  1. 6 1
      src/heredoc.c

+ 6 - 1
src/heredoc.c

@@ -32,7 +32,12 @@ void	prompt_redirection(t_e *e, t_pipe *p, t_pipe_redir *t)
 	stdfd = dup(0);
 	dup2(pipefd[0], 0);
 	wait(NULL);
-	pipe_init(e, t->itxt);
+	if (fork() == 0)
+	{
+		manage_cmd_2(e, cmd_splitting(e, t->itxt, ' '));
+		exit(0);
+	}
+	wait(NULL);
 	close(pipefd[0]);
 	close(0);
 	dup(stdfd);