Merge commit, fixed warnings

This commit is contained in:
Maieul BOYER 2024-08-14 18:16:54 +02:00
commit 13bc603a59
No known key found for this signature in database
13 changed files with 158 additions and 113 deletions

View file

@ -6,7 +6,7 @@
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2024/08/10 18:43:18 by maiboyer #+# #+# */
/* Updated: 2024/08/11 11:30:09 by maiboyer ### ########.fr */
/* Updated: 2024/08/14 18:15:30 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -22,6 +22,7 @@ t_error builtin_echo__(t_state *state, t_builtin_spawn_info info, t_i32 *exit_co
bool print_line;
t_string s;
(void)(state);
print_line = true;
i = 1;
s = string_new(1024);
@ -39,7 +40,6 @@ t_error builtin_echo__(t_state *state, t_builtin_spawn_info info, t_i32 *exit_co
string_push(&s, info.args.buffer[i]);
if (print_line)
string_push_char(&s, '\n');
// TODO: change the null to the actual redirection thingy, this needs to be done in the handle_builtin function beforehand
me_printf_fd(info.stdout, "%s", s.buf);
string_free(s);
return (*exit_code = 0, NO_ERROR);