diff options
author | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 13:55:12 +0200 |
---|---|---|
committer | JozanLeClerc <bousset.rudy@gmail.com> | 2020-08-04 13:55:12 +0200 |
commit | 48acb01ff5a2cf22adebfc25213c2597911b2fd4 (patch) | |
tree | d19162a4fad16be55ea90d7e661866224bdd3de7 /src/b_export.c | |
parent | Export is working (diff) | |
download | 42-minishell-48acb01ff5a2cf22adebfc25213c2597911b2fd4.tar.gz 42-minishell-48acb01ff5a2cf22adebfc25213c2597911b2fd4.tar.bz2 42-minishell-48acb01ff5a2cf22adebfc25213c2597911b2fd4.tar.xz 42-minishell-48acb01ff5a2cf22adebfc25213c2597911b2fd4.tar.zst 42-minishell-48acb01ff5a2cf22adebfc25213c2597911b2fd4.zip |
Unset is fine
Diffstat (limited to 'src/b_export.c')
-rw-r--r-- | src/b_export.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/b_export.c b/src/b_export.c index 43e1c7d..fa9a6d1 100644 --- a/src/b_export.c +++ b/src/b_export.c @@ -26,7 +26,7 @@ #include "u_vars.h" static t_bool - check_valid_identifier(const char *arg) + check_valid_identifier(const char arg[]) { char *ptr; @@ -47,7 +47,9 @@ static t_bool while (*ptr != '\0') { if (*ptr == '=') + { return (TRUE); + } ptr++; } return (FALSE); @@ -86,25 +88,24 @@ uint8_t t_msh *msh) { /* TODO: norme */ - const uint64_t argc = u_builtins_get_argc((const char**)args); - char **ptr; - char *varval; - char fmt[4096]; - t_bool next; - uint8_t r; + char **ptr; + char *varval; + char fmt[4096]; + t_bool next; + uint8_t r; - if (argc == 0) + if (args[0] == NULL) { return (b_env(NULL, msh)); } - ptr = args; r = 0; - while (*ptr) + ptr = args; + while (*ptr != NULL) { next = FALSE; if (check_valid_identifier(*ptr) == FALSE) { - f_fail_identifier("export", *ptr, msh); + f_fail_identifier("export", *ptr); next = TRUE; r = 1; } |