diff options
| author | Christopher Uhlig | 2025-01-14 18:18:58 +0100 |
|---|---|---|
| committer | Christopher Uhlig | 2025-01-14 18:18:58 +0100 |
| commit | da80405b345b58f9e1bd83039b1df3771b5ca193 (patch) | |
| tree | d8ddb9fa078fa353dc55992dd9609a0c798e56ad /src/env.c | |
| parent | 8c37f835ba29bcecc1d779edb396d97b18667026 (diff) | |
| download | minishell-da80405b345b58f9e1bd83039b1df3771b5ca193.tar.gz minishell-da80405b345b58f9e1bd83039b1df3771b5ca193.zip | |
update for exit bit norm removed staic stuff added prompt flag
Diffstat (limited to 'src/env.c')
| -rw-r--r-- | src/env.c | 23 |
1 files changed, 21 insertions, 2 deletions
@@ -6,11 +6,12 @@ /* By: chuhlig <chuhlig@student.42.fr> +#+ +:+ +#+ */ /* +#+#+#+#+#+ +#+ */ /* Created: 2024/10/17 14:31:07 by chuhlig #+# #+# */ -/* Updated: 2024/12/17 19:36:14 by chuhlig ### ########.fr */ +/* Updated: 2025/01/14 14:44:34 by chuhlig ### ########.fr */ /* */ /* ************************************************************************** */ #include "env.h" +#include "minishell.h" #include <stdlib.h> void getenvlst(t_env **env, char **en) @@ -59,4 +60,22 @@ char *env_get(t_env *env, char *name) env = env->next; } return (NULL); -}
\ No newline at end of file +} + +t_env *env_new(char *name) +{ + t_env *result; + + result = malloc(sizeof(t_env)); + if (!result) + return (NULL); + result->name = name; + return (result); +} + +void free_env_node(t_env *node) +{ + free(node->name); + free(node->value); + free(node); +} |
