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/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);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user