aboutsummaryrefslogtreecommitdiff
path: root/src/env.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/env.c')
-rw-r--r--src/env.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/src/env.c b/src/env.c
index 9620782..589c83e 100644
--- a/src/env.c
+++ b/src/env.c
@@ -6,7 +6,7 @@
/* By: cacharle <marvin@42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/02/28 09:21:24 by cacharle #+# #+# */
-/* Updated: 2020/07/15 17:30:53 by charles ### ########.fr */
+/* Updated: 2020/07/16 08:44:28 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -138,3 +138,18 @@ char *env_export(t_env env, char *key, char *value)
}
return (joined);
}
+
+char *env_export_full(t_env env, char *variable)
+{
+ char *key;
+ char *value;
+
+ key = variable;
+ value = ft_strchr(variable, '=');
+ if (value == NULL)
+ return (NULL);
+ *value = '\0';
+ key = env_export(env, key, value + 1);
+ *value = '=';
+ return (key);
+}