This commit is contained in:
Jack Halford 2017-03-26 14:15:50 +02:00
parent f0c7252607
commit 49349c3adb
3 changed files with 8 additions and 9 deletions

View file

@ -6,7 +6,7 @@
/* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */ /* By: ariard <ariard@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2017/03/25 18:20:42 by ariard #+# #+# */ /* Created: 2017/03/25 18:20:42 by ariard #+# #+# */
/* Updated: 2017/03/25 21:23:11 by ariard ### ########.fr */ /* Updated: 2017/03/26 14:11:03 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -31,7 +31,7 @@ static t_cliopts g_cdopts[] =
{0, NULL, 0, 0, NULL, 0}, {0, NULL, 0, 0, NULL, 0},
}; };
int cd_file_autorisations(char *target, int flag) int cd_file_autorisations(char *target, int flag)
{ {
(void)flag; (void)flag;
if (access(target, F_OK)) if (access(target, F_OK))

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */ /* Created: 2016/12/07 18:07:50 by jhalford #+# #+# */
/* Updated: 2017/03/25 20:27:32 by jhalford ### ########.fr */ /* Updated: 2017/03/26 14:11:44 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -19,7 +19,6 @@ void data_exit(void)
data = data_singleton(); data = data_singleton();
ft_strdel(&data->line.input); ft_strdel(&data->line.input);
ft_strdel(&data->binary); ft_strdel(&data->binary);
/* exec_popfds(); */
ft_sstrfree(data->env); ft_sstrfree(data->env);
ft_sstrfree(data->local_var); ft_sstrfree(data->local_var);
ft_sstrfree(data->argv); ft_sstrfree(data->argv);

View file

@ -6,7 +6,7 @@
/* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */ /* By: jhalford <jhalford@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */ /* +#+#+#+#+#+ +#+ */
/* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */ /* Created: 2016/12/12 17:23:59 by jhalford #+# #+# */
/* Updated: 2017/03/25 01:41:36 by wescande ### ########.fr */ /* Updated: 2017/03/26 14:13:44 by jhalford ### ########.fr */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -89,10 +89,10 @@ int shell_init(int ac, char **av, char **env)
if (data_init(ac, av, env) < 0) if (data_init(ac, av, env) < 0)
return (-1); return (-1);
if (cliopts_get(av, g_opts, data)) if (cliopts_get(av, g_opts, data))
return (ft_perror(NULL) {
&& SH_ERR("%s", SHELL_USAGE1) return (ft_perror(NULL) && SH_ERR("%s", SHELL_USAGE1)
&& SH_ERR("%s", SHELL_USAGE2) && SH_ERR("%s", SHELL_USAGE2) && SH_ERR("%s", SHELL_USAGE3));
&& SH_ERR("%s", SHELL_USAGE3)); }
if (!isatty(STDIN) || *data->av_data) if (!isatty(STDIN) || *data->av_data)
data->opts &= ~(SH_INTERACTIVE | SH_OPTS_JOBC); data->opts &= ~(SH_INTERACTIVE | SH_OPTS_JOBC);
if ((data->fd = get_input_fd(data, NULL)) < 0) if ((data->fd = get_input_fd(data, NULL)) < 0)