diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-21 22:45:45 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-04-21 22:45:45 +0200 |
commit | 1903646e160346bc2fb3cc617689500cee03ff12 (patch) | |
tree | ba461440ed54bb3cbf6c6f44ccf8339f3a6553a6 /src/ft_b_export.c | |
parent | Tryna export (diff) | |
download | 42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.gz 42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.bz2 42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.xz 42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.tar.zst 42-minishell-1903646e160346bc2fb3cc617689500cee03ff12.zip |
I'll finish export later
Diffstat (limited to 'src/ft_b_export.c')
-rw-r--r-- | src/ft_b_export.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/src/ft_b_export.c b/src/ft_b_export.c index be4d94d..767db08 100644 --- a/src/ft_b_export.c +++ b/src/ft_b_export.c @@ -50,25 +50,30 @@ uint8_t ft_b_export(char *args[], t_msh *msh) { - char **ptr; const uint64_t argc = ft_get_argc((const char**)args); - int8_t next; + char **ptr; + int8_t next; + uint8_t r; if (argc == 0) { return (ft_b_env(NULL, msh)); } ptr = args; + r = 0; while (*ptr) { next = 0; if (!ft_check_valid_identifier(*ptr)) { ft_fail_identifier("export", *ptr); + next = 1; + r = 1; } - ft_check_equals(*ptr); + if (next == 0 && !ft_check_equals(*ptr)) + next = 1; ptr++; } /* TODO: finish export */ - return (0); + return (r); } |