save commit
This commit is contained in:
18
minishell-codex/src/core/init.c
Normal file
18
minishell-codex/src/core/init.c
Normal file
@@ -0,0 +1,18 @@
|
||||
#include "minishell.h"
|
||||
|
||||
void ms_init(t_shell *sh, char **envp)
|
||||
{
|
||||
memset(sh, 0, sizeof(*sh));
|
||||
sh->interactive = isatty(STDIN_FILENO);
|
||||
sh->exit_status = 0;
|
||||
sh->last_status = 0;
|
||||
sh->exit_requested = 0;
|
||||
env_init(sh, envp);
|
||||
ms_setup_signals(sh);
|
||||
}
|
||||
|
||||
void ms_cleanup(t_shell *sh)
|
||||
{
|
||||
env_clear(sh);
|
||||
rl_clear_history();
|
||||
}
|
||||
Reference in New Issue
Block a user