aboutsummaryrefslogtreecommitdiff
path: root/src/builtin/export.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/builtin/export.c')
-rw-r--r--src/builtin/export.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/builtin/export.c b/src/builtin/export.c
index 650a421..1d362b3 100644
--- a/src/builtin/export.c
+++ b/src/builtin/export.c
@@ -6,7 +6,7 @@
/* By: charles <charles.cabergs@gmail.com> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:11:34 by charles #+# #+# */
-/* Updated: 2020/04/01 22:37:47 by charles ### ########.fr */
+/* Updated: 2020/04/03 12:11:38 by charles ### ########.fr */
/* */
/* ************************************************************************** */
@@ -21,11 +21,13 @@ int builtin_export(char **argv, t_env env)
{
char *tmp;
+ // modify existing
+ // set with no string without '='
if (ft_strchr(argv[1], '=') == NULL)
return (1);
if ((tmp = ft_strdup(argv[1])) == NULL)
return (2);
- if (ft_vecpush(env, tmp) == NULL)
+ if (ft_vecinsert(env, env->size - 1, tmp) == NULL)
return (2); // internal error code
return (0);
}