diff options
| author | Charles Cabergs <me@cacharle.xyz> | 2020-09-15 17:54:48 +0200 |
|---|---|---|
| committer | Charles Cabergs <me@cacharle.xyz> | 2020-09-15 17:54:48 +0200 |
| commit | f626f2715ab696fdb326ed67256d012d86faef9f (patch) | |
| tree | f25f2d95688a89c662622e3c2f11786f27689713 /src/eval/exec.c | |
| parent | 170d0b74fa725196bca0fa549520d0d8bfa07576 (diff) | |
| download | minishell-f626f2715ab696fdb326ed67256d012d86faef9f.tar.gz minishell-f626f2715ab696fdb326ed67256d012d86faef9f.tar.bz2 minishell-f626f2715ab696fdb326ed67256d012d86faef9f.zip | |
Refactoring env, Removing bloat from utils, exec and env
Diffstat (limited to 'src/eval/exec.c')
| -rw-r--r-- | src/eval/exec.c | 65 |
1 files changed, 0 insertions, 65 deletions
diff --git a/src/eval/exec.c b/src/eval/exec.c deleted file mode 100644 index f733c34..0000000 --- a/src/eval/exec.c +++ /dev/null @@ -1,65 +0,0 @@ -/* ************************************************************************** */ -/* */ -/* ::: :::::::: */ -/* exec.c :+: :+: :+: */ -/* +:+ +:+ +:+ */ -/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */ -/* +#+#+#+#+#+ +#+ */ -/* Created: 2020/04/01 17:06:11 by charles #+# #+# */ -/* Updated: 2020/09/14 19:48:49 by charles ### ########.fr */ -/* */ -/* ************************************************************************** */ - -/* -** \file exec.c -** \brief Executable name and path -*/ - -#include "eval.h" - -/* -** \brief Check if executable path is valid -** \param exec_path Executable path -** \return status code -*/ - -int exec_path_check(char *exec_path) -{ - struct stat statbuf; - - if (stat(exec_path, &statbuf) == -1) - return (errorf_ret(127, "%s: %s\n", exec_path, strerror(errno))); - if (S_ISDIR(statbuf.st_mode)) - return (errorf_ret(126, "%s: Is a directory\n", exec_path)); - if (!(statbuf.st_mode & 0444)) - return (errorf_ret(126, "%s: %s\n", exec_path, strerror(EACCES))); - return (0); -} - -/* -** \brief Search executable name in path -** \param path Path hash table -** \param path_var Path environment string in case we need to update path -** \param exec_name Executable name to search -** \return Executable path or NULL if not found or path update error -*/ - -/* int exec_search_path(t_path path, char *path_var, char *exec_name, char **exec_path) */ -/* { */ -/* if (ft_strchr(exec_name, '/') != NULL) // TODO test recursive link */ -/* { */ -/* *exec_path = exec_name; */ -/* return (0); */ -/* } */ -/* if (path_var == NULL) */ -/* return (127); */ -/* // TODO if PATH contain empty path, consider current directory files as cmd */ -/* if ((*exec_path = ft_htget(path, exec_name)) == NULL) */ -/* { */ -/* if (path_update(path, path_var) == NULL) */ -/* return (EVAL_FATAL); */ -/* if ((*exec_path = ft_htget(path, exec_name)) == NULL) */ -/* return (127); */ -/* } */ -/* return (0); */ -/* } */ |
