Je suis tout dur façe a Samantha

This commit is contained in:
Etienne Rey-bethbeder 2023-02-23 13:36:26 +01:00
parent 29a4a864c3
commit 0661f2fbd1
3 changed files with 25 additions and 5 deletions

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 14:56:02 by cchauvet #+# #+# */
/* Updated: 2023/02/14 14:58:40 by cchauvet ### ########.fr */
/* Updated: 2023/02/23 13:20:55 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
@ -27,3 +27,12 @@ int print_env(t_list **head, int fd)
}
return (0);
}
/*int main(int argc, char *argv[], char **env)
{
t_list **be;
be = init_env(env);
print_env(be, 1);
return (0);
}*/

15
env.c
View File

@ -6,7 +6,7 @@
/* By: erey-bet <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* 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);
}*/

View File

@ -6,7 +6,7 @@
/* By: cchauvet <cchauvet@student.42angoulem +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2023/02/14 13:45:30 by cchauvet #+# #+# */
/* Updated: 2023/02/22 01:47:21 by erey-bet ### ########.fr */
/* Updated: 2023/02/23 13:35:42 by erey-bet ### ########.fr */
/* */
/* ************************************************************************** */
@ -79,7 +79,7 @@ int print_export(t_list **head, int fd);
/* CD */
int move_folder(char *path, int fd);
/* UNSET */
int unset(t_list **env, char **args, int fd);
int unset(t_list **env, char **args);
typedef struct s_cmd
{