Commit 812ef0ba authored by abenoit's avatar abenoit
Browse files

details

parent ed76dcfb
......@@ -47,6 +47,8 @@ static void create_fd(char *cur_arg, enum e_redir_op redir,
mode = S_IRUSR | S_IWUSR | S_IRGRP | S_IWGRP | S_IROTH;
if (redir == APPEND)
flags |= O_APPEND;
else
flags |= O_TRUNC;
}
*redir_fd = open(cur_arg, flags, mode);
}
......
......@@ -38,7 +38,7 @@ int clean_and_exit(int err_code, t_xe *xe)
ret = 1;
ft_putstr_fd("minishell takes no argument\n", STDERR_FILENO);
}
else if (err_code == SUCCESS)
else if (err_code == SUCCESS && !(xe->flags &EXIT_FLAGS))
ret = EXIT_SUCCESS;
else
{
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment