Normed the builtins
This commit is contained in:
parent
efb18f605c
commit
ef7677f2ee
5 changed files with 70 additions and 57 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/10 18:43:18 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/08/14 18:15:05 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/08/30 16:55:02 by rparodi ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -14,15 +14,17 @@
|
|||
#include "me/convert/str_to_numbers.h"
|
||||
#include "me/types.h"
|
||||
|
||||
t_error builtin_exit__(t_state *state, t_builtin_spawn_info info, t_i32 *exit_code)
|
||||
t_error builtin_exit__(\
|
||||
t_state *state, t_builtin_spawn_info info, t_i32 *exit_code)
|
||||
{
|
||||
t_i32 actual_exit_code;
|
||||
t_i32 actual_exit_code;
|
||||
|
||||
(void)(state);
|
||||
if (info.args.len < 2)
|
||||
actual_exit_code = 0;
|
||||
else if (str_to_i32(info.args.buffer[1], 10, &actual_exit_code))
|
||||
return (printf("info.args.buffer[1] = %s\n", info.args.buffer[1]), 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);
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue