Fixed exit builtin

This commit is contained in:
Maix0 2024-08-11 12:53:03 +02:00
parent ea1908e644
commit ecf01a6b8b
3 changed files with 16 additions and 5 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:26:03 by maiboyer ### ########.fr */
/* Updated: 2024/08/11 12:41:07 by maiboyer ### ########.fr */
/* */
/* ************************************************************************** */
@ -21,7 +21,7 @@ t_error builtin_exit__(t_state *state, t_builtin_spawn_info info, t_i32 *exit_co
if (info.args.len < 2)
actual_exit_code = 0;
else if (str_to_i32(info.args.buffer[1], 10, &actual_exit_code))
return (ERROR);
return (printf("info.args.buffer[1] = %s\n", info.args.buffer[1]), ERROR);
*exit_code = actual_exit_code;
me_exit(actual_exit_code);
return (NO_ERROR);