diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-14 20:48:50 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-14 21:35:51 +0200 |
| commit | a2a51b77a5534978f30f2788f7ed9cbe4fda3089 (patch) | |
| tree | 628d23cfbe2f1badc5e5fac1a647fd40f10d0fc9 /include | |
| parent | 3693acaff9fbf3f34dc2907e95dd221d5a8bc9e4 (diff) | |
| download | minishell-a2a51b77a5534978f30f2788f7ed9cbe4fda3089.tar.gz minishell-a2a51b77a5534978f30f2788f7ed9cbe4fda3089.tar.bz2 minishell-a2a51b77a5534978f30f2788f7ed9cbe4fda3089.zip | |
Removing path hash table, replacing it by brute force search
Diffstat (limited to 'include')
| -rw-r--r-- | include/eval.h | 14 | ||||
| -rw-r--r-- | include/minishell.h | 5 |
2 files changed, 8 insertions, 11 deletions
diff --git a/include/eval.h b/include/eval.h index 6aaefd9..02d0624 100644 --- a/include/eval.h +++ b/include/eval.h @@ -6,7 +6,7 @@ /* By: charles <charles@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/04/01 17:05:30 by charles #+# #+# */ -/* Updated: 2020/09/14 17:20:14 by charles ### ########.fr */ +/* Updated: 2020/09/14 19:49:18 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -24,7 +24,6 @@ typedef struct { - t_path path; t_env env; t_ast *ast; int fds[2]; @@ -32,7 +31,7 @@ typedef struct typedef struct { - char *exec_path; + char exec_path[PATH_MAX + 1]; char **argv; t_env env; t_builtin_entry *builtin; @@ -49,25 +48,25 @@ extern pid_t g_child_pid; */ int fork_wrap(int fds[2], void *passed, int (*wrapped)(void *param), pid_t *child_pid); -int eval(int fds[2], t_env env, t_path path, t_ast *ast, pid_t *child_pid); +int eval(int fds[2], t_env env, t_ast *ast, pid_t *child_pid); /* ** cmd.c */ -int eval_cmd(int fds[2], t_env env, t_path path, t_ast *ast, pid_t *child_pid); +int eval_cmd(int fds[2], t_env env, t_ast *ast, pid_t *child_pid); /* ** operation.c */ -int eval_operation(int fds[2], t_env env, t_path path, t_ast *ast); +int eval_operation(int fds[2], t_env env, t_ast *ast); /* ** parenthesis.c */ -int eval_parenthesis(int fds[2], t_env env, t_path path, t_ast *ast); +int eval_parenthesis(int fds[2], t_env env, t_ast *ast); /* ** redir.c @@ -80,6 +79,5 @@ int redir_extract(t_tok_lst **redirs, t_env env, int fds[2]); */ int exec_path_check(char *exec_path); -int exec_search_path(t_path path, char *path_var, char *exec_name, char **exec_path); #endif diff --git a/include/minishell.h b/include/minishell.h index 95f299b..0dd0522 100644 --- a/include/minishell.h +++ b/include/minishell.h @@ -6,7 +6,7 @@ /* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2020/02/26 15:33:51 by cacharle #+# #+# */ -/* Updated: 2020/09/14 15:36:04 by charles ### ########.fr */ +/* Updated: 2020/09/14 19:50:06 by charles ### ########.fr */ /* */ /* ************************************************************************** */ @@ -48,7 +48,6 @@ # define BUILTIN_NOT_FOUND -2 -typedef t_ftht* t_path; typedef t_ftvec* t_env; extern int g_last_status; @@ -58,7 +57,7 @@ extern char *g_basename; ** path.c */ -t_path path_update(t_path path, char *path_var); +bool path_search(t_env env, char *exec_name, char exec_path[PATH_MAX + 1]); /* ** env.c |
