Les mendarines Lecler, en vrai ça va, Camille est aigris mais propre, en tout cas hâte Nathan se lève

This commit is contained in:
Xamora 2023-04-04 22:03:30 +02:00
parent 0d231a062d
commit b1805834ec
4 changed files with 2 additions and 5 deletions

View File

@ -19,7 +19,7 @@ int print_env(t_list **env, int fd)
current = *env;
while (current->next != NULL)
{
if (((t_env *)(current->content))->original)
if (((t_env *)(current->content))->value)
{
ft_putstr_fd(((t_env *)(current->content))->key, fd);
ft_putstr_fd("=", fd);

View File

@ -37,7 +37,7 @@ int ft_exit(char **args)
if (err == 1)
return (error(err, "exit: numeric argument required", args[0]));
if (args[1] != NULL)
return (error(1, "exit: too many arguments", NULL));
return (error(-1, "exit: too many arguments", NULL));
if (err > 0)
return (error(err, "exit: numeric argument required", args[0]));
write(1, "exit\n", 6);

1
env/env.h vendored
View File

@ -20,7 +20,6 @@ typedef struct s_env
{
char *key;
char *value;
bool original;
} t_env;
char *ft_env_filler(t_data *data, const char *str);

2
env/env1.c vendored
View File

@ -82,7 +82,6 @@ int create_value_by_key(char *key, char *value, t_list **head)
return (1);
content->key = key;
content->value = value;
content->original = 0;
add_sort(head, content);
return (0);
}
@ -107,7 +106,6 @@ t_list **init_env(char **env)
return (NULL);
var->key = get_key(env[i]);
var->value = get_value(env[i]);
var->original = 1;
add_sort(head, var);
}
return (head);