aboutsummaryrefslogtreecommitdiff
path: root/src/env.c
diff options
context:
space:
mode:
authorChristopher Uhlig2025-01-14 18:18:58 +0100
committerChristopher Uhlig2025-01-14 18:18:58 +0100
commitda80405b345b58f9e1bd83039b1df3771b5ca193 (patch)
treed8ddb9fa078fa353dc55992dd9609a0c798e56ad /src/env.c
parent8c37f835ba29bcecc1d779edb396d97b18667026 (diff)
downloadminishell-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.c23
1 files changed, 21 insertions, 2 deletions
diff --git a/src/env.c b/src/env.c
index 0213209..1972909 100644
--- a/src/env.c
+++ b/src/env.c
@@ -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);
+}