From 3d10a9b9f62a36b686002303e86aaf02d29e4513 Mon Sep 17 00:00:00 2001 From: Maieul BOYER Date: Sun, 13 Oct 2024 14:00:32 +0200 Subject: [PATCH] fixed small error on redir --- exec/src/run_ast/_spawn_cmd_redir_fd.c | 4 ++-- exec/src/run_ast/run_pipeline.c | 4 ++-- parser/src/yard/yard_cmd.c | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/exec/src/run_ast/_spawn_cmd_redir_fd.c b/exec/src/run_ast/_spawn_cmd_redir_fd.c index 24e1f621..41d38400 100644 --- a/exec/src/run_ast/_spawn_cmd_redir_fd.c +++ b/exec/src/run_ast/_spawn_cmd_redir_fd.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/14 12:30:09 by maiboyer #+# #+# */ -/* Updated: 2024/10/12 17:51:28 by rparodi ### ########.fr */ +/* Updated: 2024/10/13 13:58:11 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -78,7 +78,7 @@ t_error _redir_output_append(\ if (fname->len != 1) return (vec_str_free(*fname), ERROR); red_fd = open_fd(fname->buffer[0], FD_WRITE, \ - O_TRUNC | O_CREAT | O_CLOEXEC, FP_ALL_READ | FP_ALL_WRITE); + O_APPEND | O_CREAT | O_CLOEXEC, FP_ALL_READ | FP_ALL_WRITE); if (red_fd == NULL) return (vec_str_free(*fname), ERROR); info->stdout = fd(red_fd); diff --git a/exec/src/run_ast/run_pipeline.c b/exec/src/run_ast/run_pipeline.c index da2c6896..1aa0ec52 100644 --- a/exec/src/run_ast/run_pipeline.c +++ b/exec/src/run_ast/run_pipeline.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/09/14 12:32:37 by maiboyer #+# #+# */ -/* Updated: 2024/10/12 17:51:26 by rparodi ### ########.fr */ +/* Updated: 2024/10/13 13:58:31 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -129,7 +129,7 @@ t_error run_pipeline(t_ast_pipeline *pipeline, t_state *state, if (child->kind == AST_COMMAND) ret |= _pipeline_cmd(child, state, &cpipe, &pids); else if (child->kind == AST_SUBSHELL) - ret |= _pipeline_cmd(child, state, &cpipe, &pids); + ret |= _subshell_cmd(child, state, &cpipe, &pids); else ret |= ((void)(printf("List in pipelines are unsupported,"\ " use a subshell !\n")), ERROR); diff --git a/parser/src/yard/yard_cmd.c b/parser/src/yard/yard_cmd.c index be86a755..07d24a2c 100644 --- a/parser/src/yard/yard_cmd.c +++ b/parser/src/yard/yard_cmd.c @@ -6,7 +6,7 @@ /* By: maiboyer +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/09 12:44:53 by maiboyer #+# #+# */ -/* Updated: 2024/10/12 17:51:57 by rparodi ### ########.fr */ +/* Updated: 2024/10/13 13:58:52 by maiboyer ### ########.fr */ /* */ /* ************************************************************************** */ @@ -47,7 +47,7 @@ static t_error _create_ast_redir(enum e_token ty, t_ast_node *out) ret->data.file_redirection.op = AST_REDIR_APPEND; else if (ty == TOK_LCARRET) ret->data.file_redirection.op = AST_REDIR_INPUT; - else if (ty == TOK_DRCARRET) + else if (ty == TOK_RCARRET) ret->data.file_redirection.op = AST_REDIR_OUTPUT; return (*out = ret, NO_ERROR); }