diff options
Diffstat (limited to 'src')
| -rw-r--r-- | src/builtins_part_one.c | 12 | ||||
| -rw-r--r-- | src/builtins_part_two.c | 4 | ||||
| -rw-r--r-- | src/env.c | 4 | ||||
| -rw-r--r-- | src/interpreter.c | 3 | ||||
| -rw-r--r-- | src/new_token.c | 27 | ||||
| -rw-r--r-- | src/parse_cmd.c | 2 | ||||
| -rw-r--r-- | src/parser.c | 4 |
7 files changed, 11 insertions, 45 deletions
diff --git a/src/builtins_part_one.c b/src/builtins_part_one.c index 629cc87..11989cc 100644 --- a/src/builtins_part_one.c +++ b/src/builtins_part_one.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/08/09 17:01:16 by chuhlig #+# #+# */ -/* Updated: 2025/01/20 17:05:19 by chuhlig ### ########.fr */ +/* Updated: 2025/01/20 19:07:18 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -26,15 +26,7 @@ int unset(char **av, t_env **env) prev = NULL; while (current) { - if ((!ft_strcmp(current->name, av[i])) && (!ft_strcmp("?", av[1]))) - { - if (prev) - prev->next = current->next; - else - *env = current->next; - free_env_node(current); - break ; - } + if (ft_strcmp(current->name, av[i]) == 0) { if (prev) prev->next = current->next; diff --git a/src/builtins_part_two.c b/src/builtins_part_two.c index d3c0929..e461861 100644 --- a/src/builtins_part_two.c +++ b/src/builtins_part_two.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/25 20:52:16 by chuhlig #+# #+# */ -/* Updated: 2025/01/18 18:57:12 by chuhlig ### ########.fr */ +/* Updated: 2025/01/20 19:12:33 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -59,7 +59,7 @@ void update_pwd(t_env **env) int cd(t_env **env, char **av) { t_env *current; - + current = *env; if (av[1] == NULL) { @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/17 14:31:07 by chuhlig #+# #+# */ -/* Updated: 2025/01/20 15:05:49 by chuhlig ### ########.fr */ +/* Updated: 2025/01/20 19:12:43 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -78,4 +78,4 @@ void free_env_node(t_env *node) free(node->name); free(node->value); free(node); -}
\ No newline at end of file +} diff --git a/src/interpreter.c b/src/interpreter.c index 6d71022..44f4b95 100644 --- a/src/interpreter.c +++ b/src/interpreter.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/12/17 19:15:49 by chuhlig #+# #+# */ -/* Updated: 2025/01/20 12:48:49 by chuhlig ### ########.fr */ +/* Updated: 2025/01/20 19:12:49 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -53,4 +53,3 @@ int eval(t_node *node, t_env **env) { return (eval_rec(node, env, STDIN_FILENO)); } - diff --git a/src/new_token.c b/src/new_token.c index 6431c7d..bd65b9d 100644 --- a/src/new_token.c +++ b/src/new_token.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/27 14:29:44 by dkaiser #+# #+# */ -/* Updated: 2024/08/29 15:30:52 by chuhlig ### ########.fr */ +/* Updated: 2025/01/20 19:12:57 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ @@ -50,28 +50,3 @@ t_token *new_redir_token(int type, t_token *previous, t_token *next) token->content.redir_type = type; return (token); } - -// void ft_append_token(int type, t_token **list)// but we need somewhere token/node head initialize with nul -// { -// t_token *node; -// t_token *last_node; - -// if (!list) -// return ; -// node = malloc(sizeof(t_token)); -// if (!node) -// return ; -// node->next = NULL; -// node->type = type; -// if (!*list) -// { -// *list = node; -// node->previous = NULL; -// } -// else -// { -// last_node = ft_lstlast(*list); -// last_node->next = node; -// node->previous = last_node; -// } -// }
\ No newline at end of file diff --git a/src/parse_cmd.c b/src/parse_cmd.c index b30d126..6505384 100644 --- a/src/parse_cmd.c +++ b/src/parse_cmd.c @@ -6,7 +6,7 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/07/08 15:06:25 by dkaiser #+# #+# */ -/* Updated: 2025/01/20 17:57:50 by dkaiser ### ########.fr */ +/* Updated: 2025/01/20 19:09:21 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ diff --git a/src/parser.c b/src/parser.c index 75f1c64..13ab10d 100644 --- a/src/parser.c +++ b/src/parser.c @@ -6,14 +6,14 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/06/29 15:53:29 by dkaiser #+# #+# */ -/* Updated: 2025/01/20 17:57:20 by dkaiser ### ########.fr */ +/* Updated: 2025/01/20 19:13:31 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ -#include "env.h" #include "libft.h" #include "minishell.h" #include "token.h" +#include "env.h" static t_token *find_token_by_type(t_token *tokens, int type); t_token *split_at_first(t_token **tokens, int type); |
