fixed argv open().
previously wrongly dup2() to STDIN.
This commit is contained in:
@@ -6,7 +6,7 @@
|
||||
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2021/10/10 23:53:17 by lperrey #+# #+# */
|
||||
/* Updated: 2021/12/20 18:06:15 by lperrey ### ########.fr */
|
||||
/* Updated: 2021/12/20 22:47:26 by lperrey ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
@@ -20,7 +20,13 @@ int exit_free(t_all *c, int exit_status)
|
||||
ft_free_2d_arr(environ);
|
||||
ft_free_2d_arr(c->path);
|
||||
free_pipeline(&c->pipeline);
|
||||
if (!isatty(STDIN_FILENO))
|
||||
if (c->script_fd)
|
||||
{
|
||||
gnl(c->script_fd, NULL, 1);
|
||||
if (close(c->script_fd) == -1)
|
||||
perror("close()");
|
||||
}
|
||||
else if (!isatty(STDIN_FILENO))
|
||||
gnl(STDIN_FILENO, NULL, 1);
|
||||
else
|
||||
rl_clear_history();
|
||||
|
||||
Reference in New Issue
Block a user