From 0661f2fbd12fc3a4f7fffd522bbaef127841080c Mon Sep 17 00:00:00 2001 From: Etienne Rey-bethbeder Date: Thu, 23 Feb 2023 13:36:26 +0100 Subject: [PATCH] =?UTF-8?q?Je=20suis=20tout=20dur=20fa=C3=A7e=20a=20Samant?= =?UTF-8?q?ha?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- builtins/env.c | 11 ++++++++++- env.c | 15 +++++++++++++-- minishell.h | 4 ++-- 3 files changed, 25 insertions(+), 5 deletions(-) diff --git a/builtins/env.c b/builtins/env.c index 87a2b34..0ba0787 100644 --- a/builtins/env.c +++ b/builtins/env.c @@ -6,7 +6,7 @@ /* By: cchauvet +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2023/02/02 14:39:56 by erey-bet #+# #+# */ -/* Updated: 2023/02/17 17:11:03 by erey-bet ### ########.fr */ +/* Updated: 2023/02/23 13:34:41 by erey-bet ### ########.fr */ /* */ /* ************************************************************************** */ @@ -19,7 +19,7 @@ void add_sort(t_list **head, t_env *var) current = *head; while (current->next != NULL - && ft_strcmp(var->key, ((t_env *)(current->content))->key) != 0) + && ft_strcmp(var->key, ((t_env *)(current->content))->key) > 0) current = current->next; if (current->content == NULL) current->content = var; @@ -108,3 +108,14 @@ t_list **init_env(char **env) } return (head); } + +/*int main(int argc, char *argv[], char **env) +{ + t_list **n_env; + + n_env = init_env(env); + delete_by_key("SSH_AUTH_SOCK", n_env); + print_env(n_env, 1); + + return (0); +}*/ diff --git a/minishell.h b/minishell.h index 416b30c..967a912 100644 --- a/minishell.h +++ b/minishell.h @@ -6,7 +6,7 @@ /* By: cchauvet