update: normed exec and finish the glob for current directory
This commit is contained in:
parent
cc1e2b7fdc
commit
fba538e344
24 changed files with 647 additions and 429 deletions
|
|
@ -6,7 +6,7 @@
|
|||
/* By: maiboyer <maiboyer@student.42.fr> +#+ +:+ +#+ */
|
||||
/* +#+#+#+#+#+ +#+ */
|
||||
/* Created: 2024/09/14 12:24:49 by maiboyer #+# #+# */
|
||||
/* Updated: 2024/09/16 19:20:52 by maiboyer ### ########.fr */
|
||||
/* Updated: 2024/09/18 21:07:23 by maiboyer ### ########.fr */
|
||||
/* */
|
||||
/* ************************************************************************** */
|
||||
|
||||
|
|
@ -16,29 +16,8 @@
|
|||
#include "me/os/os.h"
|
||||
#include "me/str/str.h"
|
||||
|
||||
void _ffree_func(struct s_ffree_state *state)
|
||||
{
|
||||
if (state == NULL)
|
||||
return ;
|
||||
hmap_env_free(state->state->env);
|
||||
hmap_env_free(state->state->tmp_var);
|
||||
close_fd(state->cmd_pipe.input);
|
||||
}
|
||||
|
||||
bool _is_builtin(t_const_str argv0)
|
||||
{
|
||||
t_usize i;
|
||||
const t_str value[] = {"cd", "echo", "env", "exit", "export", "pwd", \
|
||||
"unset", "_debug", NULL};
|
||||
|
||||
i = 0;
|
||||
if (argv0 == NULL)
|
||||
return (false);
|
||||
while (value[i] != NULL)
|
||||
if (str_compare(argv0, value[i++]))
|
||||
return (true);
|
||||
return (false);
|
||||
}
|
||||
void _ffree_func(struct s_ffree_state *state);
|
||||
bool _is_builtin(t_const_str argv0);
|
||||
|
||||
t_error _find_builtin(t_spawn_info *info, t_builtin_func *actual_func)
|
||||
{
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue