fixed argv open().

previously wrongly dup2() to STDIN.
This commit is contained in:
lperrey
2021-12-20 22:52:41 +01:00
parent 6a9b7bae1b
commit 8ed97346f7
11 changed files with 78 additions and 87 deletions

View File

@@ -6,7 +6,7 @@
/* By: lperrey <lperrey@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2021/10/08 09:22:12 by lperrey #+# #+# */
/* Updated: 2021/12/18 14:22:20 by lperrey ### ########.fr */
/* Updated: 2021/12/20 22:26:05 by lperrey ### ########.fr */
/* */
/* ************************************************************************** */
@@ -14,7 +14,8 @@
void init_readline(void);
int init_shlvl(void);
int handle_argv(t_all *c, char *argv[]);
void open_script_file(t_all *c, char *argv[]);
int init_prompt(t_all *c, int script_fd);
int init(t_all *c, char *argv[])
{
@@ -27,7 +28,8 @@ int init(t_all *c, char *argv[])
c->path = retrieve_path();
if (!init_shlvl())
return (ft_reti_perror(0, "init_shlvl()"));
if (!handle_argv(c, argv))
return (0);
open_script_file(c, argv);
if (!init_prompt(c, c->script_fd))
return (ft_reti_perror(0, "init_prompt()"));
return (1);
}