From 4c6f5998d4a9cd346b7e8d4aec0d21a0d0a84859 Mon Sep 17 00:00:00 2001 From: whaffman Date: Sat, 8 Feb 2025 19:46:45 +0100 Subject: [PATCH] print executable path --- inc/minishell.h | 2 +- src/utils/simple_builtins.c | 10 ++++------ 2 files changed, 5 insertions(+), 7 deletions(-) diff --git a/inc/minishell.h b/inc/minishell.h index 9851194..7ef896f 100644 --- a/inc/minishell.h +++ b/inc/minishell.h @@ -6,7 +6,7 @@ /* 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 */ /* */ /* ************************************************************************** */ diff --git a/src/utils/simple_builtins.c b/src/utils/simple_builtins.c index eabd2c1..3996825 100644 --- a/src/utils/simple_builtins.c +++ b/src/utils/simple_builtins.c @@ -6,7 +6,7 @@ /* 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) { char *path; - + if (cmp_value(minishell->tokens, "clear")) printf("\033[2J\033[1;1H"); else if (cmp_value(minishell->tokens, "env")) @@ -94,9 +94,7 @@ void simple_builtins(t_minishell *minishell) exit(EXIT_SUCCESS); } else if (cmp_value(minishell->tokens, "export")) - { builtin_export(minishell); - } else { path = executor_absolute_path(minishell->environment, ((t_token *)minishell->tokens->content)->value); @@ -105,8 +103,8 @@ void simple_builtins(t_minishell *minishell) else { printf("found excutable: %s\n", path); - fork_execve(minishell, path, ft_split(((t_token *)minishell->tokens->content)->value, ' ')); - + free(path); } } + }