did env, exit and export (only env printing)
This commit is contained in:
parent
3f08544384
commit
85910da2fd
3 changed files with 43 additions and 16 deletions
|
|
@ -6,18 +6,22 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/08/10 18:43:18 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/08/10 19:49:14 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/08/10 20:01:36 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
#include "exec/builtins.h"
|
||||
#include "me/printf/printf.h"
|
||||
#include "me/str/str.h"
|
||||
#include "me/string/string.h"
|
||||
#include "me/convert/str_to_numbers.h"
|
||||
#include "me/types.h"
|
||||
|
||||
t_error builtin_exit__(t_state *state, t_spawn_info info)
|
||||
{
|
||||
return (ERROR);
|
||||
}
|
||||
t_i32 exit_code;
|
||||
|
||||
if (info.arguments.len < 2)
|
||||
exit_code = 0;
|
||||
else if (str_to_i32(info.arguments.buffer[1], 10, &exit_code))
|
||||
return (ERROR);
|
||||
me_exit(exit_code);
|
||||
return (NO_ERROR);
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue