print executable path

This commit is contained in:
whaffman 2025-02-08 19:46:45 +01:00
parent 6f21f11429
commit 4c6f5998d4
2 changed files with 5 additions and 7 deletions

View File

@ -6,7 +6,7 @@
/* By: whaffman <whaffman@student.codam.nl> +#+ */ /* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/02/04 16:13:13 by whaffman #+# #+# */ /* Created: 2025/02/04 16:13:13 by whaffman #+# #+# */
/* Updated: 2025/02/08 17:15:32 by willem ######## odam.nl */ /* Updated: 2025/02/09 16:16:32 by willem ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */

View File

@ -6,7 +6,7 @@
/* By: whaffman <whaffman@student.codam.nl> +#+ */ /* By: whaffman <whaffman@student.codam.nl> +#+ */
/* +#+ */ /* +#+ */
/* Created: 2025/02/05 16:21:39 by whaffman #+# #+# */ /* Created: 2025/02/05 16:21:39 by whaffman #+# #+# */
/* Updated: 2025/02/09 11:17:51 by willem ######## odam.nl */ /* Updated: 2025/02/09 16:18:22 by willem ######## odam.nl */
/* */ /* */
/* ************************************************************************** */ /* ************************************************************************** */
@ -83,7 +83,7 @@ void fork_execve(t_minishell *minishell, char *path, char **argv)
void simple_builtins(t_minishell *minishell) void simple_builtins(t_minishell *minishell)
{ {
char *path; char *path;
if (cmp_value(minishell->tokens, "clear")) if (cmp_value(minishell->tokens, "clear"))
printf("\033[2J\033[1;1H"); printf("\033[2J\033[1;1H");
else if (cmp_value(minishell->tokens, "env")) else if (cmp_value(minishell->tokens, "env"))
@ -94,9 +94,7 @@ void simple_builtins(t_minishell *minishell)
exit(EXIT_SUCCESS); exit(EXIT_SUCCESS);
} }
else if (cmp_value(minishell->tokens, "export")) else if (cmp_value(minishell->tokens, "export"))
{
builtin_export(minishell); builtin_export(minishell);
}
else else
{ {
path = executor_absolute_path(minishell->environment, ((t_token *)minishell->tokens->content)->value); path = executor_absolute_path(minishell->environment, ((t_token *)minishell->tokens->content)->value);
@ -105,8 +103,8 @@ void simple_builtins(t_minishell *minishell)
else else
{ {
printf("found excutable: %s\n", path); printf("found excutable: %s\n", path);
fork_execve(minishell, path, ft_split(((t_token *)minishell->tokens->content)->value, ' ')); free(path);
} }
} }
} }