aboutsummaryrefslogtreecommitdiff
path: root/src/builtin
diff options
context:
space:
mode:
authorCharles <sircharlesaze@gmail.com>2020-06-19 13:31:08 +0200
committerCharles <sircharlesaze@gmail.com>2020-06-19 13:31:08 +0200
commit35434a76eaab34e4d639f5bd0a3b7ba610001c5e (patch)
treecf30a93445da19b38392c0c5e8303038164de906 /src/builtin
parenta2ebd4ad078d7056a4c28ea697cfd3ebbf09d0f6 (diff)
parentc8091831c4ce1c4cf8703b18de22441aff191f44 (diff)
downloadminishell-35434a76eaab34e4d639f5bd0a3b7ba610001c5e.tar.gz
minishell-35434a76eaab34e4d639f5bd0a3b7ba610001c5e.tar.bz2
minishell-35434a76eaab34e4d639f5bd0a3b7ba610001c5e.zip
Merge branch 'parse_cmd'
Diffstat (limited to 'src/builtin')
-rw-r--r--src/builtin/export.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/builtin/export.c b/src/builtin/export.c
index c60d8f0..f41bcb0 100644
--- a/src/builtin/export.c
+++ b/src/builtin/export.c
@@ -6,7 +6,7 @@
/* By: charles <charles@student.42.fr> +#+ +:+ +#+ */
/* +#+#+#+#+#+ +#+ */
/* Created: 2020/04/01 17:11:34 by charles #+# #+# */
-/* Updated: 2020/06/18 13:50:47 by charles ### ########.fr */
+/* Updated: 2020/06/19 11:21:50 by nahaddac ### ########.fr */
/* */
/* ************************************************************************** */
@@ -28,7 +28,7 @@ int builtin_export(char **argv, t_env env)
(void)env;
if (argv[1] == NULL)
- return (4);
+ return (0);
if(ft_isdigit(argv[1][0]))
return(0);
i = 0;
@@ -36,14 +36,14 @@ int builtin_export(char **argv, t_env env)
while(temp[i] != '\0')
{
if(temp[i] == ' ' || ft_isalnum(temp[i]) == 0)
- return(2);
+ return(0);
if (temp[i] == '=')
{
temp[i] = '\0';
- env_export(env, temp, argv[1][i + 1]);
+ env_export(env, temp, &argv[1][i + 1]);
return(0);
}
i++;
}
- return (3);
+ return (0);
}